Update UpdateSkim example (#383)

This commit is contained in:
Karl Yngve Lervåg 2016-03-05 22:32:10 +01:00
parent 6ee8358685
commit e3972d8aad

View File

@ -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
<