Edit Anything with Just 10 vi Commands
There are more than 75 separate letter and punctuation commands to learn in vi. Where should you start? This section covers the first 10 vi commands to learn, and they will enable you to edit anything. If you are new to vi, follow the preceding procedure to create a cal-junk practice file so that you don’t accidentally change an important file.
Moving Around Using the h, j, k, and l Commands
In vi, you can move the cursor by entering the commands listed in Table 20.1. Some people think that the letter l should move left, so this command also has been added.
vi Command | Description | Mnemonic | Alternative |
---|---|---|---|
h | Move left | Leftmost char | Left arrow key |
j | Move down |
Get Practical UNIX now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.