8

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?

  • 1
    It 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: |%|, |(|, |)|, |`|," – VanLaser Aug 26 '15 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). – VanLaser Aug 26 '15 at 23:35
  • @VanLaser The help is the same, my previous understanding is incorrect. – Thomson Aug 27 '15 at 0:47
9

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 |}|.

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 right 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. – cbaumhardt Aug 27 '15 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.