How do I copy one character at a time from the line above or below while typing in insert mode?
<C-e> / <C-y> (insert mode)
In insert mode, copies the character directly below the cursor (from the next line) and copies the character directly above (from the previous line).
category:
editing
tags:
#editing
#insert-mode
#completion
How do I complete identifiers using ctags from within insert mode?
Pressing in insert mode opens a completion menu populated from your project's tags file.
category:
editing
tags:
#completion
#insert-mode
#editing
How do I log all Vim verbose output to a file to diagnose slow startup or plugin issues?
:set verbosefile=/tmp/vim.log verbose=9
Vim's verbosefile option redirects all verbose tracing output to a file on disk instead of printing it to the screen.
category:
config
tags:
#config
#debugging
#startup
#verbose
#ex-commands
How do I keep concealed text hidden even on the cursor line so Markdown or LaTeX stays formatted while I navigate?
When 'conceallevel' is 2 or higher, Vim hides syntax markers—turning raw Markdown like bold into visual bold or collapsing LaTeX commands.
category:
config
tags:
#config
#formatting
#conceal
#markdown
How do I jump to the opening or closing brace of the block surrounding my cursor?
The [{ motion jumps to the previous unmatched { — the opening brace of the block enclosing your cursor.
category:
navigation
tags:
#navigation
#motions
#editing
#normal-mode
How do I enable a popup menu for command-line tab completion in Neovim?
Setting wildoptions=pum tells Neovim to use its popup menu for command-line tab completion instead of the traditional horizontal wildmenu bar.
category:
config
tags:
#config
#completion
#command-line
How do I prevent Vim from adding a newline at the end of a file when saving?
By default, Vim enforces POSIX compliance by appending a final newline to any file that lacks one.
category:
config
tags:
#config
#editing
#files
#ex-commands
How do I create a key mapping that behaves differently depending on context?
:nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
Expression mappings use the flag to evaluate a Vimscript expression at the time the key is pressed.
category:
config
tags:
#config
#normal-mode
#ex-commands
#navigation
How do I use Neovim's built-in default LSP keymaps for rename, references, and code actions?
Neovim 0.
category:
plugins
tags:
#navigation
#completion
How do I create a Visual selection for the previous search match instead of the next one?
Most users know gn for selecting the next search match, but its counterpart gN is the real power move when you need to work backward through matches.
category:
visual-mode
tags:
#visual-mode
#search
#motions
#editing
#normal-mode
How do I find invalid UTF-8 byte sequences in a file in Vim?
The 8g8 command searches forward from the cursor for the first byte that belongs to an invalid UTF-8 sequence.
category:
navigation
tags:
#navigation
#search
#encoding
#unicode
#editing
How do I use a Vim expression as the replacement string in a :s substitution?
Vim's :s command normally replaces matches with a literal string.
category:
command-line
tags:
#search
#editing
#ex-commands
#command-line
#registers
How do I quickly see where a keyword was first defined or used without jumping there?
Pressing [i in normal mode displays the first line above the cursor (including included files) that contains the keyword under the cursor.
category:
navigation
tags:
#navigation
#search
#normal-mode
How do I search for and highlight text that exceeds a specific column width like 80 or 120?
The pattern /\%>80v.
category:
search
tags:
#search
#navigation
#normal-mode
How do I copy characters from the line above or below the cursor while staying in insert mode?
<C-y> (above) / <C-e> (below)
In insert mode, inserts the character from the same column one line above, and inserts the character from the same column one line below.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
How do I run a shell command on a range of lines in normal mode and replace them with the output?
In normal mode, !{motion} sends the lines covered by the motion to a shell command's stdin and replaces them with stdout.
category:
editing
tags:
#editing
#ex-commands
#normal-mode
#formatting
How do I anchor a Vim search pattern to match only at the very start or end of the entire file?
Vim's ^ and $ anchors match the start and end of a line, but sometimes you need to match the very beginning or very end of the entire buffer.
category:
search
tags:
#search
#regex
#ex-commands
How do I make keyword completion preserve the capitalization style I started typing?
The infercase option makes Vim's keyword completion smart about capitalization: it adapts each match to reflect the casing of the characters you've already type
category:
config
tags:
#completion
#insert-mode
#config
How do I list all lines matching a pattern across the current file and its includes?
The :ilist command searches for a pattern not only in the current buffer but also in files referenced by #include directives (or whatever 'include' is set to).
category:
search
tags:
#search
#ex-commands
#navigation
#editing
How do I create a normal mode mapping that correctly captures and passes a count prefix to a function?
nnoremap <key> :<C-u>call MyFunc(v:count)<CR>
When writing custom mappings that call Vimscript functions, a common pitfall is that any count you type before the key (e.
category:
config
tags:
#config
#macros
#ex-commands
#normal-mode