setlocal spell spelllang=en_gb setlocal tabstop=2 shiftwidth=2 function! SyncTeXToPDF() call system('zathura --synctex-forward ' . \ line('.') . ':' . col('.') . ':' . shellescape(bufname('%')) . ' ' . \ shellescape(g:synctex_zathura_pdf_filename)) endfunction function! g:SyncPDFToTeX(input, line) " Focus the window vim is running in. exe "silent !i3-msg '[id=\"" . environ()['WINDOWID'] . "\"] focus'" " Open the file name and jump to the right line. " Mysteriously, we need `cd .` to fix the file name in the tabline. " Putting this in one `exe` seems to reduce flickering. exe 'tab drop ' . a:input . ' | silent ' . a:line . ' | silent cd .' endfunction map :call SyncTeXToPDF()