aboutsummaryrefslogtreecommitdiff
path: root/vim/.vim/after
diff options
context:
space:
mode:
Diffstat (limited to 'vim/.vim/after')
-rw-r--r--vim/.vim/after/ftplugin/tex.vim18
1 files changed, 10 insertions, 8 deletions
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 <C-T> :call SyncTeXToPDF()<CR>