VIM으로 C 소스를 html 로 보기좋게 바꿔주는 script 예제
| 코드: |
| #!/bin/bash # Script code by JaeHyuk Cho <mailto:minzkn@infoeq.com> # See also moniwiki's vim processor if [ -n "$1" ] then DEF_SOURCE=$1 else echo "Usage: c.sh <source> <html>" exit 1 fi if [ -n "$2" ] then DEF_OUT=$2 else DEF_OUT=out.html fi DEF_VIM=/usr/bin/vim $DEF_VIM -T xterm -e -s "$DEF_SOURCE" \ +"syntax on" +"set syntax=c" +"so \$VIMRUNTIME/syntax/2html.vim" \ +"%s/<title>.*title>\|<\/\?head>\|<\/\?html>\|<meta.*>\|<\/\?body.*>//g" \ +"%s/<pre>/<pre style='font-family,monospace:FixedSys;color:#c0c0c0;background-color:black'>/g" \ +"wq! $DEF_OUT" +"q" exit $? # End of c.sh |




댓글을 달아 주세요