How do I configure :make to run the current file as a script with a specific interpreter?
Setting makeprg to include % lets :make always execute the file you're currently editing.
category:
config
tags:
#config
#makeprg
#workflow
#quickfix
How do I quickly open my vimrc configuration file from anywhere in Vim?
The :e $MYVIMRC command opens your Vim or Neovim configuration file instantly, no matter where it lives.
category:
config
tags:
#config
#vimrc
#workflow
How do I compile a custom word list into a Vim spell file for faster spell checking?
:mkspell ~/.vim/spell/en.utf-8.add
When you add words to your personal spell file with zg, Vim writes them to a plain-text .
category:
config
tags:
#config
#search
How do I keep concealed text hidden while navigating but automatically reveal it when my cursor enters insert mode?
The 'concealcursor' option controls in which modes concealed text is revealed on the cursor line.
category:
config
tags:
#config
#display
#editing
#concealment
How do I control how many columns Vim scrolls horizontally at once when the cursor reaches the screen edge?
When wrap is off and the cursor moves past the edge of the screen, Vim jumps the view horizontally by a number of columns determined by sidescroll.
category:
config
tags:
#config
#navigation
#editing
How do I define a mapping that only takes effect if the key is not already mapped?
:map <unique> {key} {rhs}
The modifier causes Vim to fail with an error if you try to create a mapping for a key that is already mapped in that mode.
category:
config
tags:
#config
#ex-commands
How do I use lambda functions in Vimscript to filter or transform lists?
Vim 8.
category:
config
tags:
#config
#ex-commands
How do I create a dynamic abbreviation that inserts live content like the current date?
:iabbrev <expr> {trigger} {expression}
The flag on :iabbrev turns the right-hand side into a Vimscript expression that is evaluated at expansion time rather than stored as a literal string.
category:
config
tags:
#config
#insert-mode
#abbreviations
#ex-commands
How do I change the cursor shape to a thin bar in insert mode and a block in normal mode in Neovim?
:set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20
Neovim's guicursor option lets you assign a distinct cursor shape and style to each mode, providing immediate visual feedback about which mode you are in.
category:
config
tags:
#config
#normal-mode
#insert-mode
#visual-mode
How do I set up a local leader key for file-type-specific mappings that don't conflict with global mappings?
:let maplocalleader = ','
Vim provides two separate leader keys: (global) and (local to the current buffer).
category:
config
tags:
#config
#normal-mode
#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 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 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