zathura/data/tex_zathurasynctex.vim
Sebastian Ramacher c64b4f545a Just support latexsuite for now
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
2014-01-11 23:11:59 +01:00

22 lines
801 B
VimL

" See LICENSE file for license and copyright information
" This is a sample plugin that can be used for synctex forward synchronization.
" It currently uses latexsuite to obtain the file name of the document. If you
" are not using latexsuite, it should be enough to adopt output accordingly.
" avoid re-execution
if exists("b:did_zathura_synctex_plugin") || !exists("*Tex_GetMainFileName")
finish
endif
let b:did_zathura_synctex_plugin = 1
function! Zathura_SyncTexForward()
let source = expand("%:p")
let input = shellescape(line(".").":".col(".").":".source)
let output = Tex_GetMainFileName(":p:r").".pdf"
let execstr = "zathura --synctex-forward=".input." ".shellescape(output)
silent call system(execstr)
endfunction
nmap <buffer> <Leader>f :call Zathura_SyncTexForward()<Enter>