Add Async function and Latex2PDF command to vimrc
This commit is contained in:
parent
591ea15d15
commit
ba94cdd72f
1 changed files with 11 additions and 0 deletions
11
vimrc
11
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}'] ])
|
||||
|
|
Loading…
Reference in a new issue