Who automatically writes vim registers?

339 Views Asked by At

I am playing with vim registers. Opening vim with

`vim -i NONE`

I can open vim without any register. Then I run ":NERDTree" command. After this operation, I can see these registers:

enter image description here

Now my question is. Why registers h and o exists? What exactly is stored in registers?

2

There are 2 best solutions below

4
Sabrina On

You need to know how to play:

-i {viminfo}    The file "viminfo" is used instead of the default viminfo
                file.  If the name "NONE" is used (all uppercase), no viminfo
                file is read or written, even if 'viminfo' is set or when
                ":rv" or ":wv" are used.  See also |viminfo-file|. 
                {not in Vi}

This has no relation with registers. Instead, the vim session will not use the viminfo to store marks or to preserve history of commands.

Concerning registers o and h you will get the answer in :help quote_alpha:

4. Named registers "a to "z or "A to "Z                 *quote_alpha* *quotea*
Vim fills these registers only when you say so.  Specify them as lowercase 
letters to replace their previous contents or as uppercase letters to append
to their previous contents.  When the '>' flag is present in 'cpoptions' then
a line break is inserted before the appended text
0
scrooloose On

This has just been fixed. Grab the latest nerdtree and your woes will magically disappear.