Skip to content

runtime(netrw): add tag-jump-like prompt for goto bookmark (gb)#20211

Draft
jpseibt wants to merge 2 commits into
vim:masterfrom
jpseibt:bookmark-goto-prompt
Draft

runtime(netrw): add tag-jump-like prompt for goto bookmark (gb)#20211
jpseibt wants to merge 2 commits into
vim:masterfrom
jpseibt:bookmark-goto-prompt

Conversation

@jpseibt
Copy link
Copy Markdown
Contributor

@jpseibt jpseibt commented May 13, 2026

Problem:

  • To goto a bookmark one needs to prefix a count for the bookmark number (e.g., 2gb to open bookmark#2). As the bookmark list gets or deletes entries, the numbers keep changing, requiring listing the bookmarks with qb to discover the desired bookmark number. Typing gb without a count opens g:netrw_bookmarklist[-1].

Solution:

  • If no count is given to gb, list all bookmarks and prompt for a number using inputlist(), similar to tag jump with g].

Problem:  To goto a bookmark one needs to prefix a count for the
          bookmark number (e.g., 2gb to open bookmark vim#2). As the
          bookmark list gets or deletes entries, the numbers keep
          changing, requiring listing the bookmarks with qb to
          discover the desired bookmark number. Typing gb without
          a count opens g:netrw_bookmarklist[-1].
Solution: If no count is given to gb, list all bookmarks and prompt
          for a number using inputlist(), similar to tag jump with g].

Signed-off-by: J. Paulo Seibt <jpseibt@gmail.com>
@jpseibt
Copy link
Copy Markdown
Contributor Author

jpseibt commented May 13, 2026

@chrisbra I was considering implementing the same inputlist() logic for the bookmark deletion mapping, mB (s:NetrwBookHistHandler a:chg == 6). Currently, typing mB without a count just deletes g:netrw_bookmarklist[-1].
I'm not a fan of the mapping deleting without a count prefix, because someone can delete the last bookmark entry by accident if they mistype the command for creating a bookmark (mb). However, maybe some users like to keep pressing mB to pop-out the last entry in the list.

I found this new behavior with inputlist() pretty nice. Do you think it would fit well for the deletion mapping too? If so, I could add it to this PR.

Signed-off-by: J. Paulo Seibt <jpseibt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant