Updated: 30 August 2023
:help ins-completion
Most common
:help i_CTRL-P
:help i_CTRL-N
Complete an entire line
CTRL-X CTRL-L
Freelance software engineer United Kingdom
Updated: 30 August 2023
:help ins-completion
Most common
:help i_CTRL-P
:help i_CTRL-N
Complete an entire line
CTRL-X CTRL-L
Updated: 07 November 2023
:grep uses external grep command.
:vimgrep uses vim’s internal grep facility.
:lgrep Same as :grep except the location list for the current window is used instead of the quickfix list.
Word boundaries
/\<word\>
* search for word currently under cursor.
[I show lines with matching word under cursor.
Updated: 28 October 2024
Move active window to a new tab
:tab split
Move to next tab
gt
Move to previous tab
gT
Start vim with files in horizontal splits
vim -o fileA fileB
Start vim with files in vertical splits
vim -O file1 file2
Updated: 02 January 2023
Goto halfway through a long file (no colon required)
50%
Move current line to middle of screen
zz
Updated: 10 December 2022
Restore default statusline
set statusline=
Show value of character under cursor in decimal and hex
set statusline=%b\ 0x%B
Updated: 11 September 2022
Spellcheck
:set spell spelllang=en_gb
Place cursor on word and show suggestions
z=
Updated: 10 September 2022
Updated: 01 March 2025
Current Directory is where vim was started, :pwd and :cd apply. “Directory of current file” could be different to Current Directory.
When setting the path . and ,, refer to the current directory and directory of current file.
Vim supports per tab working directories.
Neovim supports per tab working directories.
LazyVim, with no modifications, does not support per tab working directories.
Updated: 10 September 2022
Start :term
Insert mode i
Normal mode CTRL+\ CTRL+n
Updated: 30 June 2023
The quickfix list is global.
The location list is local to the current window.
Open a window to show the current list.
:cope[n]
Go to an older list
:col[der]
Go to a newer list
:cnew[er]
Go to the next error in the window
:cn
Go to the previous error in the window
:cp