Skip to content

Sioyek viewer --reuse-instance #2468

@rrueger

Description

@rrueger

The default vimtex Sioyek viewer options automatically pass --reuse-instance to Sioyek.

In this issue I argue that this option should be removed and a g:vimtex_view_sioyek_options string should be introduced similar to g:vimtex_view_zathura_options.

What happens when --reuse-instance is passed?

Every document that is opened in VimTeX will open in the same Sioyek window. If one opens two documents in VimTeX, then one cannot see both of the pdfs at the same time. Even worse, if one already has a pdf open independently of VimTeX, VimTeX will "hijack" that window and replace its contents.

What happens when --reuse-instance is not passed?

VimTeX spawns a new Sioyek instance for each document and all associated behvaiour is as expected. Despite the --reuse-instance option not being passed, when one edits a file the pdf refreshes within the same window, and when one searches with \lv VimTeX searches within the same Sioyek window. In both cases, VimTeX does not launch a new Sioyek window. This is my desired behaviour. It is exactly the same as the default zathura view method of VimTex.

What about users that want to --reuse instances?

Then can configure Sioyek to always reuse instances in their $XDG_CONFIG_HOME/sioyek/prefs_user.config.

If VimTeX introduces a g:vimtex_view_sioyek_options option, then these users can always add --reuse-instance to that.

Why can't users that don't want to --reuse instances do that?

Sioyek apparently takes priority for options stated on the command line. That is, if my $XDG_CONFIG_HOME/sioyek/prefs_user.config contains should_launch_new_instance 1, Sioyek will still --reuse the instance because that option was passed on the command line. This is also true for Sioyek's command line option --new-instance which is superseded by --reuse-instance. This means I can't create a wrapper

#/bin/bash
sioyek --new-instance "$@"

and pass this to VimTeX as g:vimtex_view_sioyek_exe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions