I am using gVim and it seems the deleted text within 1 line (except d
following some operations, like (
) doesn't go to "1
then shift the "1-"9
registers, it only goes to "-
, one example is diw
command. I didn't see this in the help (:h registers
), is this expected behavior?
-
1It is in the recent help: "Numbered register 1 contains the text deleted by the most recent delete or change command, unless the command specified another register or the text is less than one line (the small delete register is used then). An exception is made for the delete operator with these movement commands: |%|, |(|, |)|, |`|,"– VanLaserCommented Aug 26, 2015 at 22:35
-
I'm curious if you have the same text in your vim version (as I don't know if it's a recent addition).– VanLaserCommented Aug 26, 2015 at 23:35
-
@VanLaser The help is the same, my previous understanding is incorrect.– ThomsonCommented Aug 27, 2015 at 0:47
1 Answer
It is. To quote from :h quote_number
:
Numbered register 1 contains the text deleted by the most recent delete or change command, unless the command specified another register or the text is less than one line (the small delete register is used then). An exception is made for the delete operator with these movement commands: |%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|. Register "1 is always used then (this is Vi compatible).
(emphasis mine)
To briefly see the content of your registers after a "
(or <C-r>
in insert mode), you can try vim-peekaboo—it makes selecting the desired register much easier.
-
If you don't want to install a plugin like vim-peekaboo, you can also use the builtin-command
:reg
instead. The difference is that the registers are grouped in vim-peekaboo, open in a horizontal split (instead of vertical split), open without you entering a separate command and overall look visually more appealing. Commented Aug 27, 2015 at 7:59