From ba94cdd72f8100443139d763e720a71881d1ec83 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 25 Nov 2019 20:40:58 +0100 Subject: [PATCH] Add Async function and Latex2PDF command to vimrc --- vimrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vimrc b/vimrc index fb1639e..eafd94f 100644 --- a/vimrc +++ b/vimrc @@ -131,6 +131,13 @@ if !exists('s:snippets') let s:snippets = {} end +" Runs a sequence of commands asynchronously +function Async(array, ...) + if len(a:array) > 0 + call job_start(a:array[0], {"out_io": "null", "in_io": "null", "err_io": "null", "exit_cb": function("Async", [a:array[1:-1]])}) + end +endfun + function! s:make_snippet(name, lines) let s:snippets[a:name] = a:lines endfun @@ -943,3 +950,7 @@ augroup END function! s:init_markdown_file() set textwidth=80 endfunction + +" --- LaTeX Stuff --- + +command Latex2PDF call Async([ 'latex '.expand('%'), 'bibtex '.expand('%:r'), 'latex '.expand('%'), 'latex '.expand('%'), 'dvipdfm '.expand('%:r').'.dvi', ['/bin/bash', '-c', 'rm *.{aux,bbl,dvi,log,blg}'] ])