How do I execute a single normal mode command without leaving insert mode?
Pressing while in insert mode drops you into a special "insert-normal" mode where you can execute exactly one normal mode command, then immediately return to in
category:
editing
tags:
#insert-mode
#normal-mode
#editing
#workflow
How do I list only modified or active buffers in Vim?
The :ls command (or :buffers) supports filter flags that narrow the buffer list to specific states.
category:
buffers-windows
tags:
#buffers
#ex-commands
#workflow
#navigation
How do I combine the dot command with macros for powerful repeat workflows?
The dot command (.
category:
macros
tags:
#macros
#dot-command
#repeat
#workflow
How do I replace a visual selection with yanked text without losing my clipboard?
When you paste over a visual selection with p, Vim replaces the selection with the register contents — but it also puts the deleted selection into the unnamed
category:
visual-mode
tags:
#visual-mode
#registers
#paste
#workflow
How do I find out which script or plugin defined a specific mapping or setting?
:verbose map <key> or :verbose set option?
The :verbose prefix shows where a mapping, setting, command, or function was defined — which file and line number.
category:
command-line
tags:
#command-line
#debugging
#config
#mappings
#workflow
How do I execute Vimscript code from the current buffer?
:source % or :'<,'>source
The :source command executes Vimscript from a file.
category:
command-line
tags:
#command-line
#vimscript
#workflow
#development
How do I use yanked text as the replacement in a substitute command?
The \=@0 replacement expression inserts the contents of register 0 (last yank) as the replacement text.
category:
search
tags:
#search
#substitute
#registers
#workflow
How do I resize Vim windows to exact dimensions?
:resize N / :vertical resize N
The :resize and :vertical resize commands set a window to an exact number of lines or columns.
category:
buffers-windows
tags:
#windows
#layout
#resize
#workflow
What are Vim's read-only special registers and how do I use them?
". / "% / ": / "# registers
Vim has four read-only special registers that automatically contain useful contextual information.
category:
registers
tags:
#registers
#special-registers
#workflow
#productivity
How do I understand which register Vim uses for each operation?
Vim has 10 types of registers, each serving a specific purpose.
category:
registers
tags:
#registers
#reference
#clipboard
#workflow
How do I make a macro that finds and operates on specific patterns?
qq /pattern<CR> {commands} q
By incorporating a search command inside a macro, you can make it jump to the next occurrence of a pattern before performing its edits.
category:
macros
tags:
#macros
#search
#recording
#workflow
#advanced
How do I manage files and directories as a regular Vim buffer?
oil.nvim: edit directory listing like a buffer
oil.
category:
plugins
tags:
#plugins
#file-management
#neovim
#oil
#workflow
How do I find and open a file by name without knowing its full path?
The :find command searches for a file by name across all directories in your path setting and opens it.
category:
buffers-windows
tags:
#buffers
#file-management
#navigation
#workflow
How do I apply a macro across multiple files at once?
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
category:
macros
tags:
#macros
#batch-editing
#multi-file
#ex-commands
#workflow
How do I jump back and forth between my two most recent cursor positions?
Vim maintains a jumplist — a history of every "jump" you make (searches, marks, gg, G, %, etc.
category:
navigation
tags:
#navigation
#jumplist
#motions
#workflow
How do I use the leader key to create my own keyboard shortcuts?
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
category:
config
tags:
#config
#mappings
#vimrc
#leader
#workflow
How do I quickly jump between a small set of frequently used files?
Harpoon: mark files and jump with <leader>1-4
Harpoon by ThePrimeagen provides instant access to a curated list of files you're actively working on.
category:
plugins
tags:
#plugins
#navigation
#neovim
#harpoon
#workflow
How do I see all search matches highlighted as I type the pattern?
The combination of incsearch and hlsearch gives you live, interactive search highlighting.
category:
search
tags:
#search
#config
#highlighting
#workflow
How do I write and edit a macro as text instead of recording it live?
Write keystrokes in buffer, then "qy$
Instead of recording a macro in real-time (where mistakes mean starting over), you can write the keystrokes as text in a buffer, edit them visually, and then ya
category:
macros
tags:
#macros
#editing
#registers
#workflow
#best-practices
How do I edit a complex Ex command in a full editing window?
q: or <C-f> from : prompt
The command-line window (q:) opens a full Vim buffer containing your Ex command history.
category:
command-line
tags:
#command-line
#history
#editing
#workflow