How do I trigger a custom user-defined completion function in insert mode?
<C-x><C-u>
Vim's invokes a user-defined completion function, letting you plug any completion logic you want into the standard insert-mode completion popup.
366 results for ":w"
<C-x><C-u>
Vim's invokes a user-defined completion function, letting you plug any completion logic you want into the standard insert-mode completion popup.
:earlier
Vim's undo history is not just a linear list of changes — it records timestamps too.
<C-o>
The (Ctrl+o) command jumps the cursor backward through the jump list, returning you to previous cursor positions.
<C-^>
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
buffers-windows #navigation #buffers #normal-mode #productivity #windows
\zs and \ze in a pattern
Vim's \zs ("match start") and \ze ("match end") atoms let you narrow the actual match region within a broader pattern context.
:tabnew filename
The :tabnew filename command opens a file in a new tab page in Vim.
buffers-windows #buffers-windows #tabs #ex-commands #navigation
100@a
When you give a large count to a macro — such as 100@a — Vim automatically stops replaying the macro as soon as any step inside it fails.
<C-i>
Every time you make a "jump" — using G, /, %, :tag, , or similar commands — Vim records your position in the jump list.
z{height}<CR>
The z{height} command simultaneously resizes the current window to exactly {height} lines, scrolls so the current line sits at the top of the window, and moves
buffers-windows #buffers-windows #windows #resize #navigation
feedkeys()
The feedkeys({keys}, {flags}) function inserts a string of keystrokes into Vim's input queue as if the user had typed them.
:diffget 2
When Vim's diff mode has three or more buffers open, :diffget (or do) without an argument is ambiguous — Vim cannot determine which buffer to pull from.
qaqqa{actions}@aq@a
A recursive macro is a macro that calls itself at the end of its recording.
qaq qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat automatically until an error — such as reaching the end of the file — stops
:args **/*.py | argdo %s/old/new/gc | update
Vim can perform search-and-replace across multiple files without any plugins by combining the arglist with :argdo.
search #search #substitution #ex-commands #productivity #quickfix #arglist
autocmd BufWritePre * :%s/\s\+$//e
By adding an autocmd for the BufWritePre event, you can make Vim automatically strip trailing whitespace from every line each time you save.
:cfdo %s/old/new/g | update
The :cfdo %s/old/new/g update command performs a search and replace across every file in the quickfix list and saves each one.
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
:lua require('harpoon.mark').add_file()
Harpoon by ThePrimeagen is a Neovim plugin that maintains a small, numbered list of the files you're actively working on.
<C-v>jjc replacement<Esc>
Visual block mode's change command lets you replace a rectangular column of text across multiple lines in a single operation.
visual-mode #editing #visual-mode #block-mode #normal-mode #productivity
:{range}command
Every Ex command in Vim can be preceded by a range that specifies which lines it should operate on.
command-line #command-line #ex-commands #ranges #editing #productivity