registers.nvim icon indicating copy to clipboard operation
registers.nvim copied to clipboard

README.md to explain the difference vs builtin `:reg` command

Open mangelozzi opened this issue 2 years ago • 2 comments

What would you like registers.nvim to be able to do?

The README.md to explain why this plugin is preferable to to just using the built in :reg command. I think a lot of people think this when they first encounter the plugin.

If you have any ideas on how this should be implemented, please tell us here.

No sure, I don't understand the benefit of this plugin.

Is this a feature you are interested in implementing yourself?

No

mangelozzi avatar Sep 29 '23 15:09 mangelozzi

Summary

This plugin adds an interactive and visually pleasing UI for selecting what register item to paste or use next. It offers basic syntax highlighting, a preview, and an equally (if not more) efficient experience using vim registers. One simply uses " or C-R as one would normally, and then enjoys the benefit of seeing the contents of all filled registers without having to use the :reg command beforehand. It essentially removes an annoying step in using vim registers (checking where a specific item is, which register you might have used earlier, etc.), and lets you increase your efficiency while also increasing vim’s aesthetic.

Example Workflow

With registers.nvim:

  • Copy item to system clipboard or vim register (this can also be achieved using registers.nvim);
  • In normal mode, type the " key. The registers.nvim popup will appear.
  • You can now use the arrow keys to move to a specific item (representing an item in the vim register, i.e., what you see with :reg) in the list being displayed. Pressing enter on this item will ‘select’ it.
  • Alternatively, you can just type the highlighted character being displayed in the left margin of the popup, next to the register item you want to select. This resembles a workflow without registers.nvim, except that you get the visual feedback and confirmation of what is inside the register. It is also useful for remembering which register you placed something in ;). (I.e., type "+ to select from the system clipboard, or use the arrow keys to navigate to + and hit enter)
  • Once you have selected a register item, you can proceed to perform your desired action (e.g., yank, paste). To do this, simply use the usual keys: y, p, etc.

One can also call the registers.nvim popup through other means, not just ". For example, in insert mode, one can use C-R. If one does not want to use these key-binds (or bind your own key-binds), one can use the Registers command.

Without registers.nvim:

  • Copy item to system clipboard or vim register;
  • Use the :reg command to view registers. Make sure to remember the Name of the register item you want to use for future reference.
  • In normal mode, type ". You will get no visual feedback.
  • Now type the Name of the register item you want to select, as listed in the output of :reg.
  • Now perform the desired action (usually either yanking, y, or pasting, p)

Using registers.nvim is definitely more aesthetically pleasing and probably makes registers easier for beginners to understand—but is it actually better for experienced vim/nvim users, too?

I definitely think so. I use registers (and tmux buffers) extensively, and remembering a register’s name that I arbitrarily chose half an hour ago is not always the easiest for me. This means that I usually end up typing ", then realizing that I don’t know what to type next, opening :reg, finding the register I want (usually a quite difficult task), trying to remember its name, typing " again, forgetting the register’s name again, going back to :reg, and finally: typing "<register name>. This costs an excessive amount of time. registers.nvim has solved this problem for me because it previews the contents of a register, removing the need to remember arbitrary register names.


I hope this helped you understand why some people might use this plugin. Do you think this should be added to the README? Regards, myname

GotaLoveFiraCode avatar Dec 27 '23 17:12 GotaLoveFiraCode

@GotaLoveFiraCode that's great! If you could convert that into a PR it would be awesome.

tversteeg avatar Dec 27 '23 18:12 tversteeg