Keyboard kung fu

Now that we have Vim all set up, it's time to learn some more command line shortcuts. The first thing we will be looking at is indentation.

Indentation can be done in Vim by going into visual mode and typing V for selecting portions of text or V for selecting full lines, followed by > or < to indent right or left. Afterwards press . to repeat the last operation:

Keyboard kung fu

Any operation can be undone by hitting u and can then be redone by hitting Ctrl + R (as in undo and redo). This is the equivalent of Ctrl + Z and Ctrl + Shift + Z in most popular editors.

When in visual mode, we have the option of changing the case of letters by hitting U

Get Working with Linux – Quick Hacks for the Command Line now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.