lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.56k stars 391 forks source link

Zathura viewer with Wayland #3043

Closed GNUqb114514 closed 5 days ago

GNUqb114514 commented 5 days ago

Is your feature request related to a problem? Please describe it. I'm using vimtex with zathura and Wayland, but vimtex always report 'Viewer cannot find Zathura window ID', and it's annoying (even it's not matter for its main functionality).

I found some informations in old issues that says xdotool, the tool vimtex used to get the 'window ID', cannot work with Wayland at all (well, getting 'window ID').

Describe the solution you'd like Make the viewer 'zathura' able to detect the protocol the user is using, and use the correct tool.

Describe alternatives you've considered Just provide a new viewer.

P.S. I'd like to help you implementing this, if anybody can tell me where should I put my codes in.

lervag commented 5 days ago

Zathura does work best on Xorg with xdotool. On Wayland, it is better to use zathura_simple as it does not include the xdotool integration. Please read :help vimtex-view-zathura, which says:

Configuration: >vim
  " Main variant with xdotool
  let g:vimtex_view_method = 'zathura'

  " For simple variant without xdotool
  let g:vimtex_view_method = 'zathura_simple'

The main variant uses `xdotool` to help avoid duplicate Zathura instances.
However, in some environments, `xdotool` is not available. Here the simple
variant should work well.

I believe this should be a valid solution for you, please let me know if I'm wrong.