This is an automated archive made by the Lemmit Bot.
The original was posted on /r/neovim by /u/po2gdHaeKaYk on 2024-04-09 23:58:42.
Despite using neovim for a while, I still struggle to develop a good paste workflow. I currently use a few things:
The stock lazyvim.org configuration uses
opt.clipboard = "unnamedplus" -- Sync with system clipboard
I also use cutlass.nvim which makes it so ‘d’ and similar do not overwrite the register and ‘x’ is devoted to a ‘cut’ operation.
Here is a typical thing. I have some text I want to paste.
I have this.
abcd|efg
123455
I want to paste where there is |
Let’s say I might be either in normal mode or insert mode.
If I’m in normal mode, I might need to
- get to the location |. I might do this via searching and then tapping ‘j’ or ‘k’ to put myself into position.
- I then have to either hit ‘p’ or ‘P’.
- Then I usually have to go into insert mode, then clean up before the pasted entry (inserting spaces, , etc.)
- Then I have to Esc, go to the end of the pasted entry (somehow!), then again into insert mode then clean up the end bit.
The above might take many keypresses just to navigate backwards and forwards. The format of the pasted item might not be as simple as a single word (it rarely is). It might be multi-line or having lots of symbols.
Now let’s say that I’m already at | in insert mode.
- I either need to Esc and then use the route above
- Or I need to type the clunky * to get the paste within the insert mode.
Overall, the whole process above is messy, and takes an inordinate number of keys because of the constant switching in-and-out of insert mode.
Do any of you have any suggestions on how to paste quickly and reformat without so many keypresses?
I know that we don’t like to think this way, but using a mouse-one-handed keyboard workflow in a non-modal editor you essentially do this:
- Mouse-click where you want
- to paste
- Mouse click start, reformat
- Mouse click end, reformat
A keyboard workflow would be great, but I cringe not having a more efficient workflow.