Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use Esc in vim? [closed]

Tags:

The Vi editor was originally written on an ADM-3A terminal, which had the Escape key in place of the Tab key (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 Esc makes it compulsory to leave the hands to press Esc. I am currently learning vim. Should remap Esc to somewhere else ? What is the most common remap for this case ? or should I leave the idea of remapping Esc and continue using it ? What do pro users of vim do ?

like image 337
user537488 Avatar asked Dec 11 '10 11:12

user537488


People also ask

What does the escape key do in Vim?

save and quit To save changes and quit: To quit with saving changes in vim: Type the “escape” key to make sure you are in “edit mode”

How do I exit Vim without escape?

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.

What does Esc key do in Linux?

1. Short for Escape, Esc is a key found on the top-left corner of a computer keyboard. It allows the user to abort, cancel, or close an operation. For example, if a web page was loading slow on an Internet browser, pressing the Escape key stops the download.

How do I save and quit in Vim?

To save a file in Vim / vi, press Esc key, type :w and hit Enter key. One can save a file and quit vim / Vi by pressing Esc key, type :x and hit Enter key.


2 Answers

I have mapped Escape to otherwise unused Caps Lock. This is a common method to streamline vim's usage. This article has some alternative solutions, too. The same article links to tweaks to make the Escape-Capslock switch system-wide if you prefer.

like image 111
mike3996 Avatar answered Oct 25 '22 15:10

mike3996


An alternative for the esc key is CTRL+[ combination.
(This is a standard in VIM, no need to remap anything).

I use this shortcut all the time instead of Esc.

Also I remapped my caps lock key to Ctrl, that way it is even easier to type.

like image 29
Rüdiger Hanke Avatar answered Oct 25 '22 15:10

Rüdiger Hanke