diff --git a/autoload/vimtex/latexmk.vim b/autoload/vimtex/latexmk.vim index cbf44c5..a7e9b70 100644 --- a/autoload/vimtex/latexmk.vim +++ b/autoload/vimtex/latexmk.vim @@ -7,6 +7,8 @@ function! vimtex#latexmk#init_options() " {{{1 call vimtex#util#set_default('g:vimtex_latexmk_enabled', 1) call vimtex#util#set_default('g:vimtex_latexmk_build_dir', '') + call vimtex#util#set_default('g:vimtex_latexmk_progname', + \ get(v:, 'progpath', get(v:, 'progname'))) if !g:vimtex_latexmk_enabled | return | endif call vimtex#util#set_default('g:vimtex_latexmk_background', 0) @@ -14,8 +16,6 @@ function! vimtex#latexmk#init_options() " {{{1 call vimtex#util#set_default('g:vimtex_latexmk_continuous', 1) call vimtex#util#set_default('g:vimtex_latexmk_file_line_error', 1) call vimtex#util#set_default('g:vimtex_latexmk_options', '') - call vimtex#util#set_default('g:vimtex_latexmk_progname', - \ get(v:, 'progpath', get(v:, 'progname'))) call vimtex#util#set_default('g:vimtex_quickfix_autojump', '0') call vimtex#util#set_default('g:vimtex_quickfix_ignore_all_warnings', 0) call vimtex#util#set_default('g:vimtex_quickfix_ignored_warnings', []) @@ -418,7 +418,7 @@ function! s:latexmk_build_cmd() " {{{1 endif endif - if g:vimtex_latexmk_callback && has('clientserver') + if g:vimtex_latexmk_callback && exists('v:servername') let success = '\"' . g:vimtex_latexmk_progname . '\"' let success .= ' --servername ' . v:servername let success .= ' --remote-expr \"vimtex\#latexmk\#callback(1)\"' diff --git a/autoload/vimtex/view.vim b/autoload/vimtex/view.vim index bee4e65..b7ab850 100644 --- a/autoload/vimtex/view.vim +++ b/autoload/vimtex/view.vim @@ -333,7 +333,7 @@ endfunction function! s:zathura.start(outfile) dict " {{{2 let exe = {} let exe.cmd = 'zathura ' . g:vimtex_view_zathura_options - let exe.cmd .= ' -x "' . exepath(v:progname) + let exe.cmd .= ' -x "' . g:vimtex_latexmk_progname \ . ' --servername ' . v:servername \ . ' --remote +\%{line} \%{input}"' let exe.cmd .= ' ' . vimtex#util#shellescape(a:outfile) @@ -375,7 +375,7 @@ function! s:zathura.latexmk_append_argument() dict " {{{2 let cmd = vimtex#latexmk#add_option('new_viewer_always', '0') let cmd .= vimtex#latexmk#add_option('pdf_previewer', \ 'zathura ' . g:vimtex_view_zathura_options - \ . ' -x \"' . exepath(v:progname) + \ . ' -x \"' . g:vimtex_latexmk_progname \ . ' --servername ' . v:servername \ . ' --remote +\%{line} \%{input}\" \%S')