zathura/data/tex_zathurasynctex.vim

23 lines
824 B
VimL
Raw Normal View History

" See LICENSE file for license and copyright information
2013-12-24 17:50:38 +01:00
" 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 the calculation of
" 'output' accordingly.
2013-12-24 17:50:38 +01:00
" avoid re-execution
if exists("b:did_zathura_synctex_plugin") || !exists("*Tex_GetMainFileName")
2013-12-24 17:50:38 +01:00
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)
2013-12-24 17:50:38 +01:00
endfunction
2014-01-01 18:14:17 +01:00
nmap <buffer> <Leader>f :call Zathura_SyncTexForward()<Enter>