Search 130+ Vim and Neovim commands by category. Color-coded by mode. Click any card to copy.
Showing 166 of 166 entries — click any card to copy
NormalInsertVisualCommandAny
Frequently Asked Questions
How do I exit Vim?
The most common ways to exit Vim are: :q to quit (only works if there are no unsaved changes), :q! to quit and discard all changes, :wq or :x to save and quit, and ZZ in Normal mode to save and quit. If you are stuck in Insert mode, press Escape first to return to Normal mode, then use one of the above commands.
What is the difference between Vim and Neovim?
Neovim is a refactored fork of Vim that modernises the codebase and adds first-class support for Lua configuration, a built-in LSP client, asynchronous plugin execution, and a Tree-sitter integration for better syntax highlighting. Most Vim keybindings and vimscript configurations work in Neovim without modification, making migration straightforward. Neovim is generally preferred for new setups due to its richer plugin ecosystem and active development.
How do I search and replace across an entire file?
Use the Command mode substitution: :%s/old/new/g replaces every occurrence of 'old' with 'new' throughout the file. The % means all lines, s means substitute, and g means all occurrences on each line. Add the c flag (:%s/old/new/gc) to confirm each replacement interactively. To limit to a line range, use :1,20s/old/new/g. You can use regular expressions as the search pattern.
What are Vim registers?
Registers are named storage locations that hold text from yank, delete, and macro operations. The unnamed register ("") holds the most recent yank or delete. Named registers ("a through "z) are set explicitly with "ay (yank into a) and read with "ap (paste from a). The + register is the system clipboard. The 0 register always holds the last yank (not affected by deletes), which is useful for pasting yanked text after deletions. Use :reg to list all register contents.
How do I enable system clipboard in Vim?
Add set clipboard=unnamedplus to your .vimrc or init.vim. This makes all yank and paste operations use the system clipboard by default. Alternatively, use the + register explicitly: "+y to copy to clipboard and "+p to paste from it. On macOS you may need pbpaste/pbcopy or a clipboard provider such as xclip on Linux. Neovim supports system clipboard out of the box if a provider is available.