|
Usually, you can use the arrow keys on your keyboard to move around the open file in vi. In some cases, such as a very old or very minimal Linux installation, the arrow keys don't operate. You can always move around your file using the key commands in Table 18-1.
NOTE Be sure to use the correct case. vi is case sensitive. It doesn't see a and A as the same command. In addition to the commands to move the cursor, you can move to specific text characters or strings by searching for them. You can search for a character in a line using the f (find) command. The syntax is fx, where x is the character to find. For instance, fh moves to the next h. To search the entire file, press /. The cursor moves to the bottom of the screen. Type the text to search for. When you press <Enter>, the cursor moves to the next instance of the text. After finding one instance of the text, just press / again to search further for the same text. Use ? to search backward through the file. |
|