Edit multiple lines in Vim
Say we’ve got the following code and we want to move everything between the
<table> tags over by a tab:
<div> <table> <thead> <tr> <th>One</th> <th>Two</th> <th>Three</th> </tr> </thead> <tbody> <tr> <td>Apple</td> <td>Banana</td> <td>Carrot</td> </tr> </tbody> <table> </div>
- Move the cursor to the
visual-blockmode. In Windows this defaults to
- Move to the line with
</table>, either by pressing
jmultiple times, or entering
I. Make sure to use a capital
- Press tab to move the lines over. Only the top
<table>line will move right now.
ESC. All the other lines should move over now.
If you would rather add a change to each line after the selected character, use
A instead of