How do I step through a Vimscript command or function to debug it interactively?
The :debug command prefix puts Vim into its built-in interactive debugger before executing the given command.
category:
command-line
tags:
#ex-commands
#debugging
#command-line
#vimscript
How do I force a case-insensitive substitution without changing the global ignorecase setting?
:%s/pattern/replacement/ig
The :s substitute command accepts /i and /I flags that override your global ignorecase and smartcase settings for that single substitution, letting you choose c
category:
search
tags:
#search
#editing
#ex-commands
#normal-mode
How do I open the command-line window while I am already typing a command?
<C-f> (command-line mode)
Pressing while in the command-line (:, /, or ? prompt) opens the command-line window with your partially-typed command already loaded and ready for full Vim edi
category:
command-line
tags:
#command-line
#ex-commands
#editing
#navigation
How do I close a preview window from any other window without having to jump to it first?
Pressing z closes the preview window from any window in the current tab page.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#normal-mode
How do I paste text before the cursor while leaving the cursor positioned after the pasted content?
The gP command works like P (paste before the cursor) but leaves your cursor after the pasted text rather than at its beginning.
category:
editing
tags:
#editing
#paste
#registers
#normal-mode
How do I define a custom user command in Neovim Lua config that accepts arguments and has a description?
vim.api.nvim_create_user_command()
Neovim's Lua API provides vim.
category:
config
tags:
#config
#neovim
#lua
#command-line
#ex-commands
How do I jump only to error-level diagnostics and skip warnings and hints in Neovim?
:lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})
Neovim's built-in diagnostic system (vim.
category:
plugins
tags:
#navigation
#lsp
#diagnostics
#neovim
#normal-mode
How do I move to the start of the current screen line rather than the start of the buffer line when text is soft-wrapped?
When wrap is on, a long buffer line can span multiple screen (display) lines.
category:
navigation
tags:
#navigation
#motions
#wrap
#display-lines
#normal-mode
How do I use the caret mark to jump to the exact cursor position where I last left insert mode?
Vim automatically maintains a special mark ^ that records the exact position of the cursor the last time you left insert mode.
category:
navigation
tags:
#navigation
#marks
#insert-mode
#normal-mode
How do I stop Vim from replacing long lines with rows of '@' signs and show as much text as possible instead?
:set display+=lastline,truncate
By default, when a line is too long to fit in the window, Vim fills the remaining rows with @ characters to indicate the line continues off-screen.
category:
config
tags:
#config
#display
#long-lines
#wrap
#visual
How do I display multiple column guide lines at different widths simultaneously in Vim?
colorcolumn highlights one or more screen columns to serve as a visual ruler.
category:
config
tags:
#config
#formatting
#indentation
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 visually display tabs, trailing spaces, and end-of-line characters in Vim?
:set list listchars=tab:>-,trail:~,eol:$
Enabling list mode makes Vim render normally invisible characters using configurable symbols defined in listchars.
category:
config
tags:
#config
#editing
#indentation
#formatting
How do I undo all changes made in the last N minutes using time-based undo?
Vim's :earlier command lets you travel back through the undo history by wall-clock time rather than by the number of changes.
category:
editing
tags:
#undo-redo
#editing
#ex-commands
How do I configure Vim's command-line tab completion to show a list of matches?
:set wildmode=longest,list
By default, Vim's command-line completion just cycles through matches one at a time.
category:
config
tags:
#config
#ex-commands
#completion
#command-line
How do I view all symbols in the current file using Neovim's built-in LSP?
Since Neovim 0.
category:
plugins
tags:
#lsp
#neovim
#navigation
#symbols
#plugins
How do I disable or customize virtual text diagnostic messages in Neovim's built-in LSP?
:lua vim.diagnostic.config({virtual_text = false})
Neovim's built-in diagnostic system (vim.
category:
plugins
tags:
#lsp
#neovim
#diagnostics
#plugins
#config
How do I enable LSP inlay hints to show types and parameter names inline in Neovim?
:lua vim.lsp.inlay_hint.enable()
Neovim 0.
category:
plugins
tags:
#lsp
#neovim
#inlay-hints
#plugins
#completion
How do I trigger a code action at the cursor position using Neovim's built-in LSP?
Since Neovim 0.
category:
plugins
tags:
#lsp
#neovim
#code-action
#editing
#plugins
How do I rename a symbol under the cursor using Neovim's built-in LSP without any plugin configuration?
Since Neovim 0.
category:
plugins
tags:
#lsp
#neovim
#navigation
#rename
#code-action