How do I jump to the local or global declaration of the variable under the cursor without ctags?
Vim's gd and gD commands jump to the declaration of the identifier under the cursor by searching upward through the file — no ctags setup required.
category:
navigation
tags:
#navigation
#editing
#normal-mode
How do I edit a macro without re-recording it?
:let @q = substitute(@q, 'old', 'new', '')
Vim macros are stored as plain text in named registers, which means you can inspect and modify them directly using :let and :echo.
category:
macros
tags:
#macros
#registers
#editing
#normal-mode
How do I make Neovim restore the scroll position when navigating back through the jump list?
By default, when you navigate the jump list with (older) or (newer), Neovim restores the cursor's line and column but does NOT restore where the window was scro
category:
navigation
tags:
#neovim
#navigation
#jumplist
#config
How do I prevent a window from switching to a different buffer in Neovim?
Neovim's winfixbuf option (added in Neovim 0.
category:
buffers-windows
tags:
#neovim
#buffers
#windows
#config
How do I make floating windows semi-transparent in Neovim?
Neovim's winblend option controls the pseudo-transparency of floating windows.
category:
config
tags:
#neovim
#config
#ui
#floating-windows
How do I read man pages inside Neovim with syntax highlighting and tag navigation?
Neovim ships with a built-in :Man command (the man.
category:
command-line
tags:
#neovim
#navigation
#documentation
#command-line
How do I quickly configure Vim to parse compiler errors for a specific language using a built-in compiler plugin?
Vim ships with built-in compiler plugins for many languages and tools — including gcc, python, cargo, eslint, tsc, and more.
category:
command-line
tags:
#ex-commands
#config
#buffers-windows
#command-line
How do I step through the files in my argument list one at a time?
When Vim is opened with multiple files (e.
category:
command-line
tags:
#buffers-windows
#ex-commands
#navigation
#editing
How do I run a substitute or filter command without Vim automatically repositioning my marks?
When Vim executes commands that move or reorder lines — such as :sort, :%!sort, or :s/// across ranges — it automatically adjusts named marks to follow the
category:
command-line
tags:
#ex-commands
#marks
#editing
#normal-mode
How do I instantly erase everything I have typed on the command line and start the command over?
When you are typing a long Ex command on the : prompt and realise you've made a mistake, pressing erases everything from the cursor back to the beginning of the
category:
command-line
tags:
#command-line
#ex-commands
#editing
#insert-mode
How do I make CursorHold events fire faster so plugins and diagnostics respond more quickly?
Vim's updatetime option controls two things: how quickly the swap file is written after you stop typing, and how many milliseconds of inactivity before the Curs
category:
config
tags:
#config
#performance
#autocmd
#cursorhold
#plugins
How do I use a count with text objects to operate on multiple text objects at once?
Text objects in Vim accept a count, letting you operate on a span of multiple adjacent text objects in one command.
category:
editing
tags:
#editing
#text-objects
#normal-mode
How do I repeat a macro as many times as possible until it fails?
Prefixing a macro invocation with a large count like 999@q tells Vim to run register q up to 999 times.
category:
macros
tags:
#macros
#normal-mode
How do I jump directly to the first or last entry in the quickfix list?
:cfirst and :clast jump directly to the first or last entry in the quickfix list, skipping all intermediate results.
category:
command-line
tags:
#ex-commands
#navigation
#search
How do I reference just the filename without its extension in a Vim command?
The %:r expression expands to the current filename with its extension removed (the "root" of the filename).
category:
command-line
tags:
#ex-commands
#command-line
#editing
How do I close all folds and then open just the one containing the cursor to focus on it?
The zMzv sequence collapses every fold in the file and then re-opens only the one containing your cursor.
category:
editing
tags:
#folding
#navigation
#normal-mode
How do I programmatically read and write Vim register contents including their type from Vimscript?
The setreg(reg, value, type) and getreg(reg, 1, 1) functions give you full programmatic control over registers, including their type (characterwise, linewise, o
category:
registers
tags:
#registers
#vimscript
#macros
#ex-commands
How do I run Lua code in the context of a specific buffer without switching to it in Neovim?
vim.
category:
config
tags:
#ex-commands
#vimscript
#buffers
#config
How do I register a Lua callback that fires before every keystroke to react to keyboard input?
vim.
category:
config
tags:
#ex-commands
#vimscript
#config
#macros
How do I safely run Neovim API calls from inside a fast callback or loop without causing errors?
vim.
category:
config
tags:
#ex-commands
#vimscript
#config
#completion