vim - konradmayer/knowledge-base GitHub Wiki
- In Normal mode, type "ayw to yank a word
- Press escape, and then / to search
- Then press CTRL-R and a to put register a
from https://vim.fandom.com/wiki/Jumping_to_previously_visited_locations
- Press Ctrl-O to jump back to the previous (older) location.
- Press Ctrl-I (same as Tab) to jump forward to the next (newer) location.
Display the jump list for the current window with:
:jumps
great in combination with gf
(go to file) and gd
(go to definition)
https://vim.fandom.com/wiki/Repeat_last_change
Type yiw
to copy the current word. Move the cursor to a new location, then type ciw<C-R>0<Esc>
to change the word, replacing it with the copied text. After moving the cursor to a new location, press .
to repeat the operation (the current word will be replaced with the word that was originally copied
from https://unix.stackexchange.com/a/332145:
instead of ciw
this can also be applied to next search with cgn
instead.
gq + Enter