Linux 为什么在 vim 中使用 Esc?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4416512/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why use Esc in vim?
提问by user537488
The Vi editor was originally written on an ADM-3A terminal, which had the Escapekey in place of the Tabkey (compared to most modern keyboards). Many touch typists appreciate the fact that they can leave their hands on the keyboard home row while using Vim but the use of Escmakes it compulsory to leave the hands to press Esc. I am currently learning vim. Should remap Escto somewhere else ? What is the most common remap for this case ? or should I leave the idea of remapping Escand continue using it ? What do pro users of vim do ?
Vi 编辑器最初是在 ADM-3A 终端上编写的,它用Escape键代替Tab键(与大多数现代键盘相比)。许多触摸打字员欣赏这样一个事实,即他们可以在使用 Vim 时将手放在键盘的主行上,但使用 VimEsc时必须让手按下Esc。我目前正在学习vim。应该重新映射Esc到其他地方吗?这种情况下最常见的重映射是什么?还是我应该放弃重新映射的想法Esc并继续使用它?vim 的专业用户做什么?
采纳答案by nperson325681
I have mapped Escape to otherwise unused Caps Lock. This is a common method to streamline vim's usage. This articlehas some alternative solutions, too. The same article links to tweaks to make the Escape-Capslock switch system-wide if you prefer.
我已将 Escape 映射到其他未使用的 Caps Lock。这是简化vim使用的常用方法。本文也有一些替代解决方案。如果您愿意,同一篇文章链接到使 Escape-Capslock 开关在系统范围内进行的调整。
回答by Rüdiger Hanke
An alternative for the esckey is CTRL+[combination.
(This is a standard in VIM, no need to remap anything).
esc键的替代方法是CTRL+[组合。
(这是 VIM 中的标准,无需重新映射任何内容)。
I use this shortcut all the time instead of Esc.
我一直使用这个快捷方式而不是 Esc。
Also I remapped my caps lock key to Ctrl, that way it is even easier to type.
此外,我将大写锁定键重新映射到 Ctrl,这样输入起来就更容易了。
回答by Jeffrey Jose
I have the key sequence jkmapped to Esc.
我将键序列jk映射到Esc.
You might ask, so what happens when you come across a word with jk. No problem. Type j, wait for half a second and then type k. Yes, that's non-ideal but the advantages of not having to moveyour hands of home row is much more.
您可能会问,那么当您遇到带有jk. 没问题。键入j,等待半秒钟,然后键入k。是的,这并不理想,但不必移动主排手的优势远不止于此。
I highly recommend jksequence as `Esc.
我强烈推荐jk序列为`Esc。
Other variations of the same idea are jj- which in my humble opinion wont work for me. I use jfor moving down - as others.
同一想法的其他变体是jj- 在我看来,这对我不起作用。我j用于向下移动 - 和其他人一样。
回答by ZyX
I rebinded capslock to control and right control to escape key, so pressing escape is just fine now.
我重新绑定了大写锁定控制和右控制转义键,所以现在按转义键就好了。
回答by Ted Naleid
CtrlCalso works for escape out of the box. I've got my Capslock key mapped to Ctrlas that's more useful to me in a number of situations.
CtrlC也适用于开箱即用的逃生。我已经映射了我的 Capslock 键,Ctrl因为这在许多情况下对我更有用。
回答by Wesley Rice
imap jj <ESC>
Others like to map 'jk', or 'leader-j'. I don't use hjkl nearly as much as I should.
其他人喜欢映射“jk”或“leader-j”。我几乎没有尽可能多地使用 hjkl。
回答by Aleksey Sivokon
I use Menu key instead of escape.
我使用菜单键而不是转义键。
Details are here: How to map Menu key ("Application key") to Escape key in vim?
详细信息在这里:如何将菜单键(“应用程序键”)映射到 vim 中的退出键?
回答by Xavier T.
I have personally remapped <ESC>to ii.
我个人已重新映射<ESC>到ii.
ito go in and iito go out of insert mode is easy to remember.
i进入和ii退出插入模式很容易记住。
回答by Mon Noval
I mapped mine with ;;and my right pinky finger is now aching, this is after a month of coding. I think it's a good decision to go with jjor jk.
我用我的地图绘制了;;我的右小指现在疼痛,这是经过一个月的编码。我认为选择jjor是一个很好的决定jk。
回答by Anler
I've remapped it to my right ? (mac keyboard) because it works always no matter what mode you're in or application.?
我已经将它重新映射到我的右边?(mac 键盘)因为无论您处于何种模式或应用程序,它始终有效。?

