From 295ef02922f8abb780af3c8b2ab637c9972d0595 Mon Sep 17 00:00:00 2001 From: Jonathan Yong Date: Sun, 26 Dec 2021 00:04:45 +0000 Subject: [PATCH 1/3] add option to control whether Skim gets focus upon first open --- autoload/vimtex/options.vim | 1 + autoload/vimtex/view/skim.vim | 2 +- doc/vimtex.txt | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/vimtex/options.vim b/autoload/vimtex/options.vim index b295311e1d..f28d724d41 100644 --- a/autoload/vimtex/options.vim +++ b/autoload/vimtex/options.vim @@ -426,6 +426,7 @@ function! vimtex#options#init() abort " {{{1 call s:init_option('vimtex_view_mupdf_send_keys', '') call s:init_option('vimtex_view_sioyek_exe', 'sioyek') call s:init_option('vimtex_view_skim_activate', 0) + call s:init_option('vimtex_view_skim_activate_on_start', 1) call s:init_option('vimtex_view_skim_reading_bar', 1) call s:init_option('vimtex_view_zathura_options', '') call s:init_option('vimtex_view_zathura_check_libsynctex', 1) diff --git a/autoload/vimtex/view/skim.vim b/autoload/vimtex/view/skim.vim index d464eab343..652236dc4b 100644 --- a/autoload/vimtex/view/skim.vim +++ b/autoload/vimtex/view/skim.vim @@ -13,7 +13,7 @@ endfunction let s:viewer = vimtex#view#_template#new({ \ 'name' : 'Skim', - \ 'startskim' : 'open -a Skim', + \ 'startskim' : 'open -a Skim' . (g:vimtex_view_skim_activate_on_start ? '' : ' -g'), \}) function! s:viewer.compiler_callback(outfile) dict abort " {{{1 diff --git a/doc/vimtex.txt b/doc/vimtex.txt index 9a4bdceab4..caea2665e6 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -2927,6 +2927,12 @@ OPTIONS *vimtex-options* Default value: 0 +*g:vimtex_view_skim_activate_on_start* + Set this option to 1 to make Skim have focus and be moved to the foreground + after it is first opened (usually via |:VimtexCompile| or similar). + + Default value: 1 + *g:vimtex_view_skim_reading_bar* Set this option to 1 to highlight current line in PDF after command |:VimtexView|. From 9628c1944888c98f421affaa7e9e251c0de66847 Mon Sep 17 00:00:00 2001 From: Jonathan Yong Date: Sun, 26 Dec 2021 15:30:13 +0000 Subject: [PATCH 2/3] minor doc update --- doc/vimtex.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/vimtex.txt b/doc/vimtex.txt index caea2665e6..00bb27647a 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -5208,6 +5208,7 @@ the text you want to search. Associated settings: * |g:vimtex_view_skim_activate| +* |g:vimtex_view_skim_activate_on_start| * |g:vimtex_view_skim_reading_bar| *vimtex-view-sumatrapdf* From fa674fef8668904dd7487268641f7328949fa214 Mon Sep 17 00:00:00 2001 From: Jonathan Yong Date: Mon, 27 Dec 2021 23:21:16 +0000 Subject: [PATCH 3/3] rename latexmk previewer option for Skim --- autoload/vimtex/options.vim | 2 +- autoload/vimtex/view/skim.vim | 3 +-- doc/vimtex.txt | 14 +++++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/autoload/vimtex/options.vim b/autoload/vimtex/options.vim index f28d724d41..bab5912c07 100644 --- a/autoload/vimtex/options.vim +++ b/autoload/vimtex/options.vim @@ -426,7 +426,7 @@ function! vimtex#options#init() abort " {{{1 call s:init_option('vimtex_view_mupdf_send_keys', '') call s:init_option('vimtex_view_sioyek_exe', 'sioyek') call s:init_option('vimtex_view_skim_activate', 0) - call s:init_option('vimtex_view_skim_activate_on_start', 1) + call s:init_option('vimtex_view_skim_latexmk_previewer', 'open -a Skim') call s:init_option('vimtex_view_skim_reading_bar', 1) call s:init_option('vimtex_view_zathura_options', '') call s:init_option('vimtex_view_zathura_check_libsynctex', 1) diff --git a/autoload/vimtex/view/skim.vim b/autoload/vimtex/view/skim.vim index 652236dc4b..ed407ba56f 100644 --- a/autoload/vimtex/view/skim.vim +++ b/autoload/vimtex/view/skim.vim @@ -13,7 +13,6 @@ endfunction let s:viewer = vimtex#view#_template#new({ \ 'name' : 'Skim', - \ 'startskim' : 'open -a Skim' . (g:vimtex_view_skim_activate_on_start ? '' : ' -g'), \}) function! s:viewer.compiler_callback(outfile) dict abort " {{{1 @@ -74,7 +73,7 @@ endfunction " }}}1 function! s:viewer._latexmk_append_argument() dict abort " {{{1 - return vimtex#compiler#latexmk#wrap_option('pdf_previewer', self.startskim) + return vimtex#compiler#latexmk#wrap_option('pdf_previewer', g:vimtex_view_skim_latexmk_previewer) endfunction " }}}1 diff --git a/doc/vimtex.txt b/doc/vimtex.txt index 00bb27647a..497a795de3 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -2927,11 +2927,15 @@ OPTIONS *vimtex-options* Default value: 0 -*g:vimtex_view_skim_activate_on_start* - Set this option to 1 to make Skim have focus and be moved to the foreground - after it is first opened (usually via |:VimtexCompile| or similar). - - Default value: 1 +*g:vimtex_view_skim_latexmk_previewer* + Command passed to `latexmk` to be used as the PDF previewer (i.e. the + `$pdf_previewer` variable for `latexmk`). This defaults to `'open -a Skim'`, + which means that `latexmk` will open Skim and give it focus after + successfully producing a PDF. If the focusing is unwanted, this can be + set to `'open -a Skim -g'`, which will open Skim but leave it in the + background. + + Default value: `'open -a Skim'` *g:vimtex_view_skim_reading_bar* Set this option to 1 to highlight current line in PDF after command