It is usually advertised that using VIM alleviates the need of moving the hand away from home row.
However, it seems that instead of going to CTRL, I am stretching my hand to ESC all the time.
Note: I am a new vim user and I am trying to migrate from Notepad (windows) to VIM. I am asking this question, in case there is some issue in my use or understanding of VIM philosophy.
Ctrl - [ sends the same character to the terminal as the physical Esc key. The latter is simply a shortcut for the former, generally. I once had a real vt220 terminal, and its keyboard does not have a Escape key. Pressing Ctrl+[ was the only way to generate Escape .
If you use Vim in a terminal, simply press alt/meta+normal_mode_key. Most terminals send an escape character followed by the normal_mode_key that you pressed, removing the need to press escape yourself. Thus in insert mode pressing alt+h alt+j alt+k alt+l all take you to normal mode and move in the expected direction.
Exit Vim Using a Shortcut Key In addition to command mode, Vim also has the option for shortcut keys: To save a file in Vim and exit, press Esc > Shift + ZZ. To exit Vim without saving, press Esc > Shift + ZX.
Why is my Esc button not working? There could be a number of reasons why the Esc button is not working on your Windows 11/10 PC. But a simple fix to the issue is by pressing the Shift and Escape keys. When the Esc key is not working, you can try pressing the key combination Shift + Esc to close the app.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With