How do I enable inline character-level diff highlighting in Neovim's diff mode?
:set diffopt+=linematch:60
Neovim's linematch diffopt enables intra-line diff highlighting — instead of marking an entire changed line, Neovim highlights only the specific characters th
category:
config
tags:
#config
#diff
#buffers-windows
How do I join lines without adding spaces between them?
The gJ command joins the current line with the line below it without inserting any space between them.
category:
editing
tags:
#editing
#normal-mode
#text-manipulation
#join
How do I do math calculations without leaving insert mode?
The expression register (=) lets you evaluate Vimscript expressions on the fly and insert the result directly into your text.
category:
registers
tags:
#editing
#insert-mode
#registers
#productivity
#math
How do I speed up macro execution and bulk operations by preventing screen redraws?
When Vim runs a macro or an :argdo / :bufdo loop, it redraws the screen after every command by default.
category:
config
tags:
#config
#macros
#ex-commands
How do I manually re-trigger filetype-based autocmds without reopening the file?
When you change a buffer's filetype mid-session — say with :set filetype=python — Vim updates the filetype option but does not automatically re-run the File
category:
command-line
tags:
#ex-commands
#autocmd
#filetype
#config
How do I change the filetype of the current buffer to get correct syntax highlighting and indent rules?
:setfiletype {filetype} sets the filetype option for the current buffer only if it has not already been set.
category:
command-line
tags:
#config
#ex-commands
#formatting
How do I jump to the first macro or #define definition of the word under the cursor?
Vim's [ command jumps to the first definition of the macro or identifier under the cursor, searching from the beginning of the current file and through any file
category:
navigation
tags:
#navigation
#search
#normal-mode
How do I get real-time asynchronous linting and fixing in Vim?
The ALE (Asynchronous Lint Engine) plugin provides real-time linting and automatic fixing for dozens of languages without blocking your editor.
category:
plugins
tags:
#plugins
#ale
#linting
#async
#workflow
#formatting
How do I exclude compiled files and dependency folders from Vim's file name completion?
:set wildignore+=*.pyc,*.o,node_modules/**,.git/**
wildignore is a comma-separated list of glob patterns that Vim skips when expanding file names.
category:
config
tags:
#config
#ex-commands
#completion
How do I enable smart case-sensitive searching in Vim?
:set ignorecase smartcase
How it works By setting both ignorecase and smartcase, Vim uses an intelligent case sensitivity rule for searches: If your search pattern is all lowercase, the
category:
config
tags:
#search
#editing
How do I visually select an entire code block to the matching closing brace?
Pressing V]} in normal mode enters visual line mode and immediately extends the selection to the next unmatched closing brace }.
category:
visual-mode
tags:
#visual-mode
#navigation
#text-objects
#editing
#motions
How do I make the = operator format code with an external tool like gofmt or black?
By default, Vim's = operator re-indents text using its internal rules.
category:
config
tags:
#config
#editing
#ex-commands
#formatting
#indentation
How do I search for visually selected text?
To search for the exact text you have selected in visual mode, yank it and paste it into the search prompt.
category:
search
tags:
#search
#visual-mode
#registers
How do I paste text from outside Vim without messing up indentation?
The :set paste command enables paste mode, which temporarily disables auto-indentation, smart tabs, and other insert-mode features that can mangle text pasted f
category:
config
tags:
#config
#editing
#insert-mode
How do I select functions, classes, and other code structures using Treesitter?
:TSTextobjectSelect @function.outer
The nvim-treesitter-textobjects plugin provides syntax-aware text objects powered by Treesitter's AST parsing.
category:
plugins
tags:
#plugins
#treesitter
#text-objects
#neovim
What are Vim's read-only special registers and how do I use them?
". / "% / ": / "# registers
Vim has four read-only special registers that automatically contain useful contextual information.
category:
registers
tags:
#registers
#special-registers
#workflow
#productivity
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 scroll two split windows in sync so they move together?
The scrollbind option locks two or more windows together so that scrolling in one window automatically scrolls the others by the same amount.
category:
buffers-windows
tags:
#windows
#navigation
#splits
#diff
#productivity
How do I undo all changes made within the last hour using time-based undo?
Vim's undo history is annotated with timestamps, allowing you to travel back to any point in time using :earlier and forward using :later.
category:
command-line
tags:
#undo-redo
#ex-commands
#normal-mode
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