vim Cheatsheet
Topics: vim
This cheatsheet lists common vim commands for navigation, text transformation, comments, spelling, and folding.
see vim
Navigation
{- previous paragraph}- next paragraph
Case transformation
gU- UPPER CASEgu- lower caseg~- toggle case
Replace tabs with spaces
:set expandtab
:set tabstop=2
:retab
tComment plugin
gc{motion} :: Toggle comments (for small comments within one line the &filetype_inline style will be used, if defined)
gcc :: Toggle comment for the current line
gC{motion} :: Comment region
gCc :: Comment the current line
Spelling
:setlocal spell spelllang=en_gb]s- Next error[s- Previous errorzg- Learn word under cursorzuw- Unlearn wordzw- Mark word under cursor as wrongzug- Unmark wordz=- Suggest correction1z=- I feel lucky
Folding
https://vim.fandom.com/wiki/Folding
zc- close foldzo- open foldzM- close all foldszR- open all folds:set foldenable- enable folding:set nofoldenable- disable folding