VIM: Doesn't VIM 'replace' use of CTRL with ESC?

萝らか妹 提交于 2019-12-03 22:40:55

When vi was originally written, it was written on this keyboard layout:

Note that the Esc is where Tab is on most modern day keyboard layouts and was much less of a stretch. This also explains why hjkl are the proper "arrow" keys in vim and why some of the other common keys in vim may seem like unusual selections.

yosukesabai

I almost always use Ctrl+[ instead of Esc. It is fairly easy key combination to type. The only exception is when I panic and have to escape ten times in a row.

Izkata

ESC is only used when switching from Insert/Replace to Normal mode. In Normal mode is where you spend the vast majority of your time - searching, scrolling, reading, cut/copy/paste (or, in vim terms, delete/yank/put), and so on.

While ESC is hit a lot, it shouldn't be anywhere near as much as CTRL on Notepad. However, there are also several alternative ways to avoid hitting the ESC key: http://vim.wikia.com/wiki/VimTip285 , as well as ways to put Caps Lock to use as ESC: How to map CAPS LOCK key in VIM?

Personally, I don't find it a problem, as my ESC key is the farthest key to the left on the top row; I can hit it without searching for it, and return my hands to their usual position while blindfolded. My wrist doesn't even move from its position on my laptop ;)

As lzkata pointed out, it's only used to switch from insert to normal mode. Depending on the work you're doing, you might go back and forth more often. However, as you gain experience with vim, you'll find you switch modes much less frequently. (If you're going to make small edits of different types in different locations on many lines, you CAN use the arrow keys in insert mode if the terminal supports them, but you should generally try to find other normal mode ways of making common edits - get really good with fast navigation with t, T, f, F, G, etc. )

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!