Guest User

Untitled

a guest
Jan 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #/bin/bash
  2.  
  3. OUTFILE=$(mktemp -t highlight)
  4.  
  5. INFILE=$1
  6. PARAM="set nonumber"
  7.  
  8. if [ -z "$INFILE" ]
  9. then
  10. echo "usage: $0 source.file"
  11. exit
  12. fi
  13.  
  14. vim +"$PARAM" \
  15. +'let html_use_css=1' \
  16. +'TOhtml' \
  17. +'/<pre>/,/<\/pre>/d a' \
  18. +'g/./d' \
  19. +'1pu! a' \
  20. +'$d' \
  21. +"wq! $OUTFILE" \
  22. +'q!' $INFILE &>/dev/null
  23.  
  24. cat $OUTFILE && rm $OUTFILE
Add Comment
Please, Sign In to add comment