Shift + Arrow Keys: Resize windows.Ctrl + -/Ctrl + +: Decrease/Increase font size.
nvim +<line_number> <file>: Open file and jump to the specified line.nvim +/<pattern> <file>: Open file and search for the pattern.nvim -d <file1> <file2>: Open two files and show their diff.nvim -c "normal <command>" <file>: Open file and execute a normal mode command.nvim $(find <dir> -iname <pattern>): Open files found by the find command.<command> | nvim -: Open output of a shell command in Neovim.
- Create a numbered column:
Ctrl+Q(block select withj/k), theng Ctrl+A. - Exit terminal mode:
Ctrl+\ Ctrl+N. - Delete all buffers:
:%bd. - Save session to Session.vim:
:mks!. Open with:nvim -S Session.vim. - Run macro on multiple lines: Start recording with
qa, stop withq, block select lines withCtrl+Qandj/k, then:norm! @a. - Search and replace in all buffers:
:bufdo %s/<pattern>/<replace>/ge | update. - Search and run normal command:
:%g/<pattern>/norm <command>, e.g.,:%g/foo/norm d3j. - Search and replace in all files:
:Rg <pattern>, select all withAlt+A, then:cfdo %s/<pattern>/<replace>/gc | update. - Delete lines not matching a pattern:
:g!/<pattern>/d- or
:v/\v(<pattern>)/d
- Set bookmark 'a':
ma— Jump to bookmark 'a':`a - Correct typo/grammar:
z= - Output result of a Vim command to a file:
:redir @a, run command,:redir END, then open file and type"ap.