Vim nnoremap 创建 `n * <<_`

huangapple go评论81阅读模式
英文:

Vim nnoremap creates `n <Esc> * <<_`

问题

I understand that you want a translation of the provided text. Here it is:

由于某种原因,当我创建绑定 nnoremap &lt;c-[&gt; &lt;&lt;_ 时,它会创建额外的正常模式绑定,看起来像是 n &lt;Esc&gt; * &lt;&lt;_:nmap 中,这导致每次我在正常模式下按 Escape 键时都会缩进行。我没有映射 Esc 绑定,它似乎是 nnoremap &lt;c-[&gt; &lt;&lt;_ 的副作用,如果我注释掉这行,奇怪的行为就消失了,如果我源化 $MYVIMRC 文件以带有注释行,它不会移除 Esc 绑定,我必须退出并打开 nvim 才能生效。您知道可能是什么原因吗?

提前感谢。

英文:

Hi for some reason when I create a binding nnoremap &lt;c-[&gt; &lt;&lt;_
it creates additional normal mode bindind which looks like n &lt;Esc&gt; * &lt;&lt;_ in :nmap, which results in shifting lines indent every time when I press Escape key in normal mode. I did not map Esc binding it sort of commes as side effect of nnoremap &lt;c-[&gt; &lt;&lt;_ as if I comment out this line strange behaviour disappears if I source $MYVIMRC file with the commented line it does not remove the Esc binding I have to exit and open nvim in order for this to take effect. Do you know what could be causing this?

Thanks in advance.

答案1

得分: 3

<kbd>Control-[</kbd> 是 <kbd>Esc</kbd>。 请参阅 https://en.wikipedia.org/wiki/Control_character:

> 27 (escape, ESC, \e (GCC only), ^[). 引入了一个转义序列。

英文:

<kbd>Control-[</kbd> is <kbd>Esc</kbd>. See https://en.wikipedia.org/wiki/Control_character:

> 27 (escape, ESC, \e (GCC only), ^[). Introduces an escape sequence.

huangapple
  • 本文由 发表于 2020年1月3日 21:17:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/59579269.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定