O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

Table 20.1. Moving Around Using the h, j, k, and l Commands
vi CommandDescriptionMnemonicAlternative
hMove leftLeftmost charLeft arrow key
jMove down

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required