Clear vim register, but still able to paste

vim, vim-registers

Solution

:let @a=''

a is the real name of the register

A is just a way of appending to a

:let @A=''

appends nothing to register a i.e. has no effect (this explanation added later)

:let @A='fred'      appends fred to a
:let @A=@b          appends register b to register a

Problem

I wanted to yank all matching lines of a buffer in a give register. I choose "A ``` :g/<match>/y A ``` did this trick for me.I guess ``` "Ap ``` is the command to paste A's content, I got my matching lines plus older lines as well, tried clearing A using ``` :let @A='' ``` but still able to paste using "Ap .What am I doing wrong? ``` VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 16 2013 20:39:23) MS-Windows 64-bit GUI version with OLE support Included patches: 1-52 ```

Original source