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

Manually overriding sioyek configuration #2475

Closed
elu00 opened this issue Sep 1, 2022 · 3 comments
Closed

Manually overriding sioyek configuration #2475

elu00 opened this issue Sep 1, 2022 · 3 comments
Labels

Comments

@elu00
Copy link
Contributor

elu00 commented Sep 1, 2022

Description

Hi,

Thanks as always for the great plugin!

I'm currently trying to modify the default sioyek configuration to run a slightly different command when called by vimtex; in particular, I'd like to replace the provided argument of /usr/bin/nvim to the inverse-search argument with wsl nvim.

Towards that end, I've modified the last couple lines in ~/.config/nvim/plugged/vimtex/autoload/vimtex/view/sioyek.vim to the following:

"let s:inverse_search_cmd = get(g:, 'vimtex_callback_progpath',
"      \                        get(v:, 'progpath', get(v:, 'progname', '')))
"      \ . (has('nvim')
"      \   ? ' --headless'
"      \   : ' -T dumb --not-a-term -n')
let s:inverse_search_cmd = 'wsl nvim --headless'

However, after closing and reopening nvim, opening a tex file and running \ll and \li, the default arguments to sioyek remain the same, as seen below. Is there somewhere else where I should be modifying these arguments, or am I failing to reload the changes to vimtex properly?

Thanks!

Steps to reproduce

" Plugin manager setup
set mouse=a
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" Plugins
call plug#begin()
Plug 'lervag/vimtex'
call plug#end()

" Vim-tex
" turn spellcheck on for tex documents
autocmd BufRead,BufNewFile *.tex setlocal spell
let g:vimtex_quickfix_autoclose_after_keystrokes = 2
let g:vimtex_quickfix_open_on_warning = 0
let g:vimtex_view_enabled = 1
let g:vimtex_view_sioyek_exe='sioyek.exe'
let g:vimtex_view_method = 'sioyek'

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Ubuntu 18.04.6 LTS
  Vim version: NVIM v0.6.1
  Has clientserver: true
  Servername: /tmp/nvimabsoYw/0

VimTeX project: paper
  base: paper.tex
  root: /home/elu/repos/mixing
  tex: /home/elu/repos/mixing/paper.tex
  main parser: current file verified
  document class: amsart
  packages: amsbsy amsfonts amsgen amsmath amsopn amssymb amstext amsthm atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook bigintcalc bitset bm calc centernot cite color doi environ epstopdf-base etexcmds etoolbox fontenc geometry gettitlestring gimac graphics graphicx grfext hycolor hyperref iftex ifvtex indentfirst infwarerr intcalc keyval kvdefinekeys kvoptions kvsetkeys letltxmacro lmodern ltxcmds marktext mathrsfs mathtools mhsetup microtype nameref paralist pdfcol pdfescape pdftexcmds pgf pgfcomp-version-0-65 pgfcomp-version-1-18 pgfcore pgffor pgfkeys pgfmath pgfrcs pgfsys refcount rerunfilecheck showkeys stringenc suffix tcolorbox tikz trig trimspaces ulem uniquecounter url verbatim xcolor xspace
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 5
      output: /tmp/nvimabsoYw/1
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -view=none -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'paper.tex'
      pid: 15763
  viewer: sioyek
    job: 
      pid: -
      cmd: sioyek.exe --inverse-search "/usr/bin/nvim --headless -c \"VimtexInverseSearch %2 '%1'\"" --forward-search-file '/home/elu/repos/mixing/paper.tex' --forward-search-line 1 '/home/elu/repos/mixing/paper.pdf'
    cmd_start: sioyek.exe --inverse-search "/usr/bin/nvim --headless -c \"VimtexInverseSearch %2 '%1'\"" --forward-search-file '/home/elu/repos/mixing/paper.tex' --forward-search-line 1 '/home/elu/repos/mixing/paper.pdf'
  qf method: LaTeX logfile
@elu00 elu00 added the bug label Sep 1, 2022
@lervag
Copy link
Owner

lervag commented Sep 2, 2022

Thanks as always for the great plugin!

<3

I'm currently trying to modify the default sioyek configuration to run a slightly different command when called by vimtex; in particular, I'd like to replace the provided argument of /usr/bin/nvim to the inverse-search argument with wsl nvim.

Did you try to modify the option g:vimtex_callback_progpath? I.e.

let g:vimtex_callback_progpath = 'wsl nvim'

Notice, also, you can simplify your vimtex config by removing g:vimtex_view_enabled (it is 1 by default).

lervag added a commit that referenced this issue Sep 2, 2022
@elu00
Copy link
Contributor Author

elu00 commented Sep 2, 2022

Great, that does it, thanks!

With that change I think forward/inverse search and all the other fancy stuff works out of the box when compiling from WSL and running sioyek from Windows (at least for files stored under the WSL home directory).
Would it be useful for me to add a blurb about that on the FAQ?

@elu00 elu00 closed this as completed Sep 2, 2022
@lervag
Copy link
Owner

lervag commented Sep 2, 2022

Great, that does it, thanks!

Glad to hear it!

With that change I think forward/inverse search and all the other fancy stuff works out of the box when compiling from WSL and running sioyek from Windows (at least for files stored under the WSL home directory). Would it be useful for me to add a blurb about that on the FAQ?

Yes, absolutely. Feel free to suggest a section/blurb, I'll be glad to help before merging!

@elu00 elu00 mentioned this issue Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants