How do I switch to a buffer by typing part of its filename?
:b partial<Tab>
The :b (buffer) command accepts partial filename matching with tab completion.
:b partial<Tab>
The :b (buffer) command accepts partial filename matching with tab completion.
"#p or <C-r># in insert mode
The # register always contains the name of the alternate file — typically the file you were editing just before the current one.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
:term then <C-w>N for normal mode
Vim 8+ and Neovim have a built-in terminal emulator that runs inside a buffer.
command-line #command-line #terminal #workflow #productivity
:vimgrep /pattern/g **/*.ext
The :vimgrep command searches for a pattern across multiple files and loads the results into the quickfix list.
* then :%s//new/g
Pressing searches for the word under the cursor, which also loads it into the search register.
:tabnew | lcd /path/to/project
Vim's :lcd (local change directory) sets the working directory per window.
buffers-windows #buffers #windows #tabs #workflow #project-management
0 or ^ at start of macro
A common macro pitfall is assuming the cursor starts at a specific column.
g&
The g& command repeats the last substitute command across the entire file.
:let @q then use in nnoremap
Macros are stored in registers as plain keystroke strings.
:%!python3 -m json.tool
The :%! command pipes the entire buffer through an external command and replaces it with the output.
command-line #command-line #shell #formatting #json #workflow
:cq
The :cq command quits Vim and returns a non-zero exit code to the calling process.
gx
The gx command opens the URL, file path, or identifier under the cursor using the system's default handler.
navigation #navigation #netrw #workflow #browser #normal-mode
:make
The :make command runs your build tool and parses its output into the quickfix list, letting you jump directly to each error location.
command-line #command-line #quickfix #build #workflow #programming
:cwindow
The :cwindow command intelligently manages the quickfix window — it opens the window only if there are entries in the quickfix list, and closes it if the list
[on / ]on / yon
The vim-unimpaired plugin by Tim Pope provides a consistent set of bracket-based mappings for toggling Vim options, navigating paired lists, and performing comm
:TestNearest
The vim-test plugin by Janko Marohnić provides a universal interface for running tests from within Vim.
<Leader>hs / <Leader>hu
The vim-gitgutter plugin shows Git diff markers in the sign column and provides powerful commands to stage, undo, and preview individual hunks directly from Vim
vim-repeat
The vim-repeat plugin by Tim Pope extends Vim's built-in .
plugins #plugins #repeat #dot-command #workflow #normal-mode
vim-sleuth
The vim-sleuth plugin by Tim Pope automatically detects the indentation style (tabs vs spaces) and width used in a file and sets shiftwidth, expandtab, tabstop,