Update UpdateSkim example (#383)
This commit is contained in:
parent
6ee8358685
commit
e3972d8aad
@ -824,8 +824,19 @@ Options~
|
||||
" This adds a callback hook that updates Skim after compilation
|
||||
let g:vimtex_latexmk_callback_hook = 'UpdateSkim'
|
||||
function! UpdateSkim(status)
|
||||
if a:status
|
||||
call system('updateskim.sh ' . b:vimtex.tex)
|
||||
if !a:status | return | endif
|
||||
|
||||
let l:out = b:vimtex.out()
|
||||
let l:cmd = [g:vimtex_view_general_viewer, '-r']
|
||||
if !empty(system('pgrep Skim'))
|
||||
call extend(l:cmd, ['-g'])
|
||||
endif
|
||||
if has('nvim')
|
||||
call jobstart(l:cmd + [line('.'), l:out])
|
||||
elseif has('job')
|
||||
call job_start(l:cmd + [line('.'), l:out])
|
||||
else
|
||||
call system(join(l:cmd + [line('.'), shellescape(l:out)], ' '))
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
|
Loading…
x
Reference in New Issue
Block a user