Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to control whether Skim gets focus upon first open #2286

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions autoload/vimtex/options.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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_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)
Expand Down
3 changes: 1 addition & 2 deletions autoload/vimtex/view/skim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ endfunction

let s:viewer = vimtex#view#_template#new({
\ 'name' : 'Skim',
\ 'startskim' : 'open -a Skim',
\})

function! s:viewer.compiler_callback(outfile) dict abort " {{{1
Expand Down Expand Up @@ -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
11 changes: 11 additions & 0 deletions doc/vimtex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,16 @@ OPTIONS *vimtex-options*

Default value: 0

*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
|:VimtexView|.
Expand Down Expand Up @@ -5202,6 +5212,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*
Expand Down