How do I get enhanced tab completion with a visual menu for commands and file paths?
:set wildmenu wildmode=longest:full,full
By default, Vim's command-line tab completion just cycles through options.
1031 results for "i" a""
:set wildmenu wildmode=longest:full,full
By default, Vim's command-line tab completion just cycles through options.
:<C-r>"
When typing an Ex command or search pattern, you often need to insert text you've already yanked or deleted.
:t {line-number}
The :t (copy/transfer) command duplicates the current line and places it after the specified line number.
<C-v>jj"ay then "ap
How it works Vim registers remember not just the text content but also the type of selection that was used to yank it: characterwise, linewise, or blockwise.
vi{
The vi{ command visually selects everything inside the nearest pair of curly braces {}, without selecting the braces themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode
:%bd | e#
How it works Vim does not have a built-in single command to close all buffers except the current one, but you can achieve this with a two-part command: :%bd e#.
:noautocmd write
The :noautocmd modifier (abbreviated :noa) runs any subsequent Ex command while temporarily disabling all autocommand events.
:move +1 / :move -2
The :move command relocates lines to a specific position without using delete and paste.
:oldfiles
:oldfiles displays a numbered list of every file Vim has recorded in its viminfo (or shada in Neovim) file.
:options
:options opens a special Vim buffer that lists every available option, grouped by category (appearance, editing, search, etc.
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
:setlocal statusline=%f\ %m\ %y\ [%l/%L]
The :setlocal statusline command lets you override the global statusline for a specific window.
:find
The :find command searches for a file by name across all directories listed in Vim's path option, so you can open files without typing full paths.
gj
The gj command moves the cursor down by one display line rather than one physical line.
/pattern1/;/pattern2/
Vim's search offsets allow chaining two patterns together with a semicolon.
r{char} in visual mode
In visual mode, pressing r followed by a character replaces every character in the selection with that single character.
^
The ^ command moves the cursor to the first non-blank character of the current line.
":p
The : register holds the most recently executed Ex command.
registers #registers #ex-commands #normal-mode #productivity
qaYp<C-a>q99@a
By recording a macro that duplicates a line and increments its number, you can generate a numbered list of any length with a single replay command.
macros #macros #editing #normal-mode #automation #productivity
:changes
How it works Vim maintains a change list that records the position of every change you make to a buffer.