How do I save and automatically restore a buffer's fold state and cursor position across Vim sessions?
:mkview saves a snapshot of the current window — its fold states, cursor position, and local option values — to a view file on disk.
category:
buffers-windows
tags:
#folding
#buffers-windows
#config
#ex-commands
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
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 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 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 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
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 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 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 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 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 make half-page scrolling move through wrapped lines instead of jumping over them in Neovim?
By default, Neovim's half-page scroll commands (, , , ) count movement by text lines, not screen rows.
category:
config
tags:
#config
#navigation
#scrolling
How do I show documentation for the selected completion item in a popup window?
Adding popup to completeopt makes Vim display extra information — such as function signatures or documentation — for the currently highlighted completion it
category:
config
tags:
#completion
#insert-mode
#config
#editing
How do I highlight the column just past my textwidth to visually mark line length limits?
The colorcolumn option highlights one or more vertical columns to help keep lines within a length limit.
category:
config
tags:
#config
#formatting
#editing
How do I control how many fold levels are open when first opening a file?
When Vim opens a file with folds enabled, it uses the foldlevelstart option to decide how many fold levels to open automatically.
category:
config
tags:
#folding
#config
#navigation