chentoast / marks.nvim

A better user experience for viewing and interacting with Vim marks.
MIT License
788 stars 40 forks source link

Add ability to add new bookmark with prompt for virtual text #35

Open srcrip opened 2 years ago

srcrip commented 2 years ago

First off, this plugin is something I've roughly wanted for so long since extmarks were becoming a thing in nvim. I love it.

It'd be perfect if I could get one feature though: the ability to prompt the user for the virtual text to insert with this mark when adding a new bookmark. Doom emacs has this mapping where you can hit <space><enter> to either add a new bookmark, or fuzzy filter between existing ones, and its amazing. The first step to getting an interface like that would be that ability to add new bookmark text on the fly.

I think there's an existing vim function that prompts the user for input that could be used.

chentoast commented 2 years ago

There is currently an option to configure the virtual text for each bookmark group, so you can have up to 10 different messages to choose from when setting a bookmark.

More general support for adding “annotations” to specific bookmarks is something that is on my todo list. However, I think I’m going to wait until 0.6 as I want to leverage virtual lines - so annotations can be configured to show on their own lines instead of being past EOL.

srcrip commented 2 years ago

What I mean would be nice is a prompt to add that virtual text to a new item in the group though. Maybe change the table of 0-10 into an array instead.

chentoast commented 2 years ago

If you have neovim 0.6+, newest master should have something similar to what you want. You could set up a custom keybinding to place a bookmark and then prompt the user for a virtual line annotation by using require'marks'.annotate()