New general callback and expand @line for general_options_latexmk
This allows us to open the file currently where the cursor is, and the callback lets people implement scripts as they like it to open their favourite pdf viewer with the line number after compilation. latexmk's pdf_update_command doesn't let us do that.
This commit is contained in:
parent
74d19dc17d
commit
858dd7afe0
@ -131,9 +131,18 @@ endfunction
|
|||||||
|
|
||||||
" }}}2
|
" }}}2
|
||||||
function! s:general.latexmk_append_argument() dict " {{{2
|
function! s:general.latexmk_append_argument() dict " {{{2
|
||||||
|
let opts = g:vimtex_view_general_options_latexmk
|
||||||
|
let opts = substitute(opts, '@line', line('.'), 'g')
|
||||||
return vimtex#latexmk#add_option('pdf_previewer',
|
return vimtex#latexmk#add_option('pdf_previewer',
|
||||||
\ g:vimtex_view_general_viewer . ' '
|
\ g:vimtex_view_general_viewer . ' '
|
||||||
\ . g:vimtex_view_general_options_latexmk)
|
\ . opts)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}2
|
||||||
|
function! s:general.latexmk_callback() dict " {{{2
|
||||||
|
if exists("g:vimtex_view_general_callback")
|
||||||
|
exec "call " . g:vimtex_view_general_callback . "(b:vimtex.out())"
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" }}}2
|
" }}}2
|
||||||
|
@ -860,10 +860,18 @@ Options~
|
|||||||
|
|
||||||
Default value: '@pdf'
|
Default value: '@pdf'
|
||||||
|
|
||||||
|
*g:vimtex_view_general_callback*
|
||||||
|
Sets the function that is called within |vimtex#latexmk#callback| after compilation
|
||||||
|
has finished. The function should take one argument, the pdf filename. It
|
||||||
|
will be empty if it could not be compiled.
|
||||||
|
|
||||||
|
Default value: ''
|
||||||
|
|
||||||
*g:vimtex_view_general_options_latexmk*
|
*g:vimtex_view_general_options_latexmk*
|
||||||
Set options that are passed on to `latexmk` for the specified general
|
Set options that are passed on to `latexmk` for the specified general
|
||||||
viewer, see |vimtex_viewer_general|. This allows to send options that
|
viewer, see |vimtex_viewer_general|. This allows to send options that
|
||||||
ensures a unique viewer, e.g. with |vimtex_viewer_qpdfview|.
|
ensures a unique viewer, e.g. with |vimtex_viewer_qpdfview|. Only the
|
||||||
|
`@line` escape is expanded.
|
||||||
|
|
||||||
Default value: ''
|
Default value: ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user