To move around within a file without affecting your text, you must be in command mode (press Esc twice). Here are some of the commands you can use to move around one character at a time:
Command | Description |
---|---|
k | Moves the cursor up one line. |
j | Moves the cursor down one line. |
h | Moves the cursor to the left one character position. |
l | Moves the cursor to the right one character position. |
There are following two important points to be noted:
- The vi is case-sensitive, so you need to pay special attention to capitalization when using commands.
- Most commands in vi can be prefaced by the number of times you want the action to occur. For example, 2j moves cursor two lines down the cursor location.
Comments
Post a Comment