diff options
Diffstat (limited to 'fun.vim')
| -rw-r--r-- | fun.vim | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -32,13 +32,14 @@ command LongestLineLength call LongestLineLength() function! Md2Pdf ( ) exe ":w" - exe ":! pandoc -o " . expand("%:r") . ".pdf -t latex -N --variable classoption=twosides --variable papersize=a4 --variable margin-left=1in --variable margin-right=1in --variable margin-top=1in --variable margin-bottom=1in --variable links-as-notes --variable colorlinks --variable pagestyle=plain --variable documentclass=article " . expand("%") - echo "pdf saved as " . expand("%:p:r") . ".pdf" + "-N for numbered headers + exe ":! pandoc -o \"" . expand("%:r") . ".pdf\" -t latex --variable classoption=twosides --variable papersize=a4 --variable margin-left=1in --variable margin-right=1in --variable margin-top=1in --variable margin-bottom=1in --variable links-as-notes --variable colorlinks --variable pagestyle=plain --variable documentclass=article -f markdown-implicit_figures \"" . expand("%") . "\"" + echo "pdf saved as \"" . expand("%:p:r") . ".pdf\"" endfunction function! Md2Pdfms ( ) exe ":w" - exe ":! pandoc -o " . expand("%:r") . ".pdf" . " -t ms -N " . expand("%") + exe ":! pandoc -o " . expand("%:r") . ".pdf" . " -t ms -f markdown-implicit_figures \"" . expand("%") . "\"" echo "pdf saved as " . expand("%:p:r") . ".pdf" endfunction @@ -50,7 +51,7 @@ command Md2Pdfms call Md2Pdfms() function! Md2Html ( ) exe ":w" - exe ":! pandoc -o " . expand("%:r") . ".html" . " -s -N " . expand("%") + exe ":! pandoc -o \"" . expand("%:r") . ".html\"" . " -s \"" . expand("%") . "\"" echo "html saved as " . expand("%:p:r") . ".html" endfunction @@ -66,3 +67,17 @@ function! CompRunProj ( ) endfunction command CompRunProj call CompRunProj() + + +" Function made to give feedback to students code in 1INF01 + +" export C code to syntax highlighted pdf +function! C2Pdf ( ) + exe ":set ts=4" + exe ":w" + exe ":ha > %.ps" + exe ":!ps2pdf %.ps" + exe ":!rm %.ps" +endfunction + +command C2Pdf call C2Pdf() |
