aboutsummaryrefslogtreecommitdiff
path: root/vim/.latexmkrc
diff options
context:
space:
mode:
Diffstat (limited to 'vim/.latexmkrc')
-rw-r--r--vim/.latexmkrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/vim/.latexmkrc b/vim/.latexmkrc
index 2d07232..a36a2ce 100644
--- a/vim/.latexmkrc
+++ b/vim/.latexmkrc
@@ -13,6 +13,7 @@ $pdf_previewer .= 'zathura';
# -x for synctex: connect to the rpc socket, switch to the file and jump to the line
$pdf_previewer .= ' -x "nvim --headless --cmd';
$pdf_previewer .= ' \'let skt=sockconnect(\\"pipe\\",\\"$SERVER\\",{\\"rpc\\":1})';
+# SwitchToFileOrOpen switches to a file or opens it if there is no window yet; see .vimrc
$pdf_previewer .= ' | call rpcrequest(skt,\\"nvim_command\\",\\"SwitchToFileOrOpen %{input}\\")';
$pdf_previewer .= ' | call rpcrequest(skt,\\"nvim_command\\",\\"%{line}\\")';
# mysteriously, we need `cd .` to fix the file name in the tabline
@@ -23,7 +24,11 @@ $pdf_previewer .= ' | quit\'"';
$pdf_previewer .= ' %S &';
# nvim for editing; start up the server as part of the command line
-$pdf_previewer .= 'urxvt -e nvim --cmd "let g:server_name = serverstart(\'$SERVER\')" %T';
+$pdf_previewer .= 'urxvt -e nvim';
+$pdf_previewer .= ' --cmd "let g:server_name = serverstart(\'$SERVER\')"';
+# this is for forward synctex; see .vim/after/ftplugin/tex.vim
+$pdf_previewer .= ' --cmd "let g:synctex_zathura_pdf_filename = \'%S\'"';
+$pdf_previewer .= ' %T';
push @extra_pdflatex_options, '-synctex=1' ;
push @extra_pdflatex_options, '-halt-on-error' ;