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

Improve docs for opening links in existing split: How to give [reuse] Argument to VimwikiSplitLink? #1382

Open
kiedan opened this issue Nov 21, 2023 · 2 comments
Labels
documentation good first issue link Related to link and path creation, modification, use [See #478] question For usage and configuration questions, user support, etc.

Comments

@kiedan
Copy link

kiedan commented Nov 21, 2023

Sometimes I would like to leave my index page open in a split and open links next to it. The help for VimwikiSplitLink states:

„If the argument 'reuse' is given and nonzero, the link is opened in a possibly existing split window instead of making a new split.“

That sounds perfect for this usecase, however I can‘t seem to figure out how to pass the reuse argument …

:VimwikiVSplitLink -reuse
:VimwikiVSplitLink -reuse=1

… and a few other things I tried did not work. (It opens a new split but always a new one for every link)
What is the correct syntax here?

—-
Wimwiki Version: 2023.05.12
NVIM v0.9.4

@kiedan
Copy link
Author

kiedan commented Nov 27, 2023

PS: I think this the argument should be given directly, without a seperator, right?
So it should just be:
:VimwikiVSplitLink reuse
But still: I get a new split every time. Perhaps somebody can confirm if the command is correct this way?

@brennen brennen added bug link Related to link and path creation, modification, use [See #478] documentation regression question For usage and configuration questions, user support, etc. and removed bug regression labels Jan 23, 2024
@brennen
Copy link
Member

brennen commented Jan 23, 2024

Hmm, yeah, I couldn't seem to get this to work at first.

Looking at the start of follow_split():

function! vimwiki#base#follow_link(split, ...) abort
  " Jump to link target (Enter press, Exported)
  let reuse_other_split_window = a:0 >= 1 ? a:1 : 0
  let move_cursor_to_new_window = a:0 >= 2 ? a:2 : 1

reuse_other_split_window is getting set...

Finally realized that the string "reuse" is false, as far as Vim is concerned. What you need here is:

:VimwikiVSplitLink 1

This isn't super clear from the docs. We can fix that up.

@brennen brennen changed the title Opening Links in existing Split: How to give [reuse] Argument to VimwikiSplitLink? Improve docs for opening links in existing split: How to give [reuse] Argument to VimwikiSplitLink? Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation good first issue link Related to link and path creation, modification, use [See #478] question For usage and configuration questions, user support, etc.
Projects
None yet
Development

No branches or pull requests

2 participants