Minimalistic approach (I don't want to spend 10000 hours to become a neovim guru):
- Learn minimal set of commands to reduce cognitive load.
- Install least number of plugins for the simplest configuration (avoid them as much as possible).
- Easy switch to bare vi when needed.
Quick navigation in the current line:
- Search for the word you want to go to:
/<word>(forward) or?<word>(backward), press andn. If youset hlsearchand want to quickly unhighlight, you can addnnoremap // :nohlsearch<CR>to yourinit.vimfile. Then you can double press//to unhighlight search. - Use
f/torF/Tcommands and;to repeat the move.f<space>can be very convenient here.
I prefer this instead of w/b.
This helps me keep the minimum number of commands in my muscle memory.
I don't have to think which command is the best. I always use the same for all kind of things.
The f/t is very useful in conjunction with d/c commands and . to repeat.
- Jump to previous edit locations:
g;(or just the last one with`., but why should I remember this one). - Jump forward to edit locations (in case you went to far with
g;):g,.
-
zz- move current line to the middle of the screen. -
zt- move current line to the top of the screen. -
zb- move current line to the bottom of the screen. -
Ctrl-e- scroll one line down, constant pressing works. -
Ctrl-y- scroll one line up, constant pressing works.
Less usefull to me:
Ctrl-d- scroll down half screen, constant pressing works.Ctrl-u- scroll up half screen, constant pressing works.
I never use page down/up (Ctrl-b/Ctrl-f).
If I then want to move the cursor to a specific line after scrolling, I use: <n>G (set number must be set in init.vim).
cc- replace current line.C- replace to end of line.
Normal mode:
x- delete current character.X- delete previous character.
Insert mode:
BACKSPACE- delete previous character.Ctrl-w- delete previous word.
Ctrl-r"- Paste content of lasty/d/ccommand.
Search modifiers:
g- whole document.c- confirm replacement.I- case sensitive.\<word\>- wholewordonly.
Useful tips:
s//- search previous pattern.*- search word under cursor; then use:%s//<replacement>/gIto replace in the whole document.
Print list of last 100 changes: :changes.