Fix Document Compile Function in vim
Fixed non-escaped directory sequence (erroring on spaces in filenames) and silent code execution.
This commit is contained in:
parent
667595d2fb
commit
804ae4005a
2 changed files with 7 additions and 6 deletions
|
@ -1,23 +1,23 @@
|
|||
function s:_compile(verbose, ...)
|
||||
:execute(":w!")
|
||||
if a:verbose
|
||||
execute "!" . "compile" . " " . "%" . " " . join(a:000)
|
||||
execute "!" . "compile" . " " . "\"%\"" . " " . join(a:000)
|
||||
else
|
||||
silent "!" . "compile" . " " . "%" . " " . join(a:000)
|
||||
silent execute "!" . "compile" . " " . "\"%\"" . " " . join(a:000)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:_open(verbose, ...)
|
||||
if a:verbose
|
||||
execute "!" . "open-compiled" . " " . "%" . " " . join(a:000)
|
||||
execute "!" . "open-compiled" . " " . "\"%\"" . " " . join(a:000)
|
||||
else
|
||||
silent "!" . "open-compiled" . " " . "%" . " " . join(a:000)
|
||||
silent execute "!" . "open-compiled" . " " . "\"%\"" . " " . join(a:000)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:_compileopen(verbose, ...)
|
||||
call s:_compile(<bang>0, <f-args>)
|
||||
call s:_open(<bang>0, <f-args>)
|
||||
call s:_compile(a:verbose, join(a:000))
|
||||
call s:_open(a:verbose, join(a:000))
|
||||
endfunction
|
||||
|
||||
command -bang -nargs=* DocCompile call s:_compile(<bang>0, <f-args>)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
" PLUGIN: vim-pandoc
|
||||
" handle markdown files with pandoc (and pandoc syntax!)
|
||||
let g:pandoc#modules#disabled = [ "keyboard", "folding" ]
|
||||
let g:pandoc#filetypes#pandoc_markdown = 1
|
||||
let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile" ]
|
||||
" disable all default keymaps
|
||||
|
|
Loading…
Reference in a new issue