more VIM tips
2018-08-01 - psic4t
- press * to search forwards for the next occurrence of the word under the cursor, or press # to search backwards.
- use ctrl-c instead of ESC. Much easier to reach.
- to position the cursor at the middle / top / bottom use M, H, or L
- bookmarks:
- bookmark current place in file: mX (X = key to assign bookmark to)
- jump to bookmark:
`
X (X = key bookmark was assigned to ` = back tick/tilde key) - show all bookmarks: :marks
- gi switches to insertion mode placing the cursor at the same location it was previously.
- = to indent selected text, gg=G (or =G if you are at the beginning of your file) indents the whole buffer.
- CTRL-A adds [count] to the number or alphabetic character at or after the cursor. CTRL-X subtracts [count] from the number.
- vit visually selects everything between 2 tags, vat includes the tags. va" selects between ".