How to return from command mode to Vim?

If I'm in command mode, how do I get back? Pressing the delete key on my Macbook just moves the cursor left one place. The fastest way I know this is h, x , but is there a better way, maybe with one key?

+7
source share
2 answers

x is deleted to the right, X is deleted to the left

This may be useful for you: Vim Cheat Sheet

+20
source

In command mode, r can also be useful in some circumstances. It allows you to replace one character under the cursor.

Usually I often use r Space to remove a character in a string without changing the indent or alignment.

For example, if you have the following code:

 var anotherOne = NULL; var short1 = NULL; var veryLongLong = NULL; 

using r Space in '1', now you have:

 var anotherOne = NULL; var short = NULL; var veryLongLong = NULL; 

instead

 var anotherOne = NULL; var short = NULL; var veryLongLong = NULL; 

In the latter case, you must switch to insert mode to add another space.

+4
source

All Articles