我正在玩vim寄存器。打开vim与谁会自动写入vim寄存器?
`vim -i NONE`
我可以打开vim没有任何注册。然后我运行“:NERDTree”命令。此操作后,我可以看到这些寄存器:
现在我的问题是。为什么注册h
和o
存在?什么存储在寄存器中?
我正在玩vim寄存器。打开vim与谁会自动写入vim寄存器?
`vim -i NONE`
我可以打开vim没有任何注册。然后我运行“:NERDTree”命令。此操作后,我可以看到这些寄存器:
现在我的问题是。为什么注册h
和o
存在?什么存储在寄存器中?
你需要知道怎么玩:
-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}
这与登记无关。相反,vim会话不会使用viminfo
来存储标记或保存命令的历史记录。
关于寄存器o
和h
你会得到答案: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
这刚刚得到修复。抓住latest nerdtree,你的困境会神奇消失。
Nerdtree可能会在内部使用它们,然后将它们还原到原来的状态(空),而不会将它们恢复到非现有状态。只有vim的最新版本允许我们这样做。除此之外并不重要 –