From 64d4b74c649c744ca9fc8cd1f9fb0f872ae85896 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 11 Nov 2025 16:29:15 +0100 Subject: Fix Zathura supporting nvim code for nvim 10.4 --- vim/.vim/after/ftplugin/tex.vim | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'vim/.vim') diff --git a/vim/.vim/after/ftplugin/tex.vim b/vim/.vim/after/ftplugin/tex.vim index 23b1a40..66be81d 100644 --- a/vim/.vim/after/ftplugin/tex.vim +++ b/vim/.vim/after/ftplugin/tex.vim @@ -8,13 +8,15 @@ function! SyncTeXToPDF() \ 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 +if !exists("*g:SyncPDFToTeX") + 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 +endif map :call SyncTeXToPDF() -- cgit v1.2.3