How do I control windows using Ex commands in scripts and mappings instead of Ctrl-W shortcuts?
:wincmd {key} is the Ex command equivalent of every {key} window shortcut.
category:
buffers-windows
tags:
#buffers-windows
#windows
#ex-commands
#normal-mode
How do I open another file without saving the current modified buffer first?
Normally, trying to :edit another file from a modified buffer triggers a warning and blocks the switch unless you save or force the command.
category:
buffers-windows
tags:
#buffers
#windows
#workflow
#command-line
#editing
How do I undo the last change in Vim?
The u command undoes the last change you made in normal mode.
category:
editing
tags:
#editing
#undo-redo
#normal-mode
How do I temporarily disable the matchparen plugin in Vim?
Vim's built-in matchparen plugin highlights matching delimiters as your cursor moves.
category:
plugins
tags:
#plugins
#performance
#editing
#autocommands
#delimiters
How do I access text from small deletes like dw or x?
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
category:
registers
tags:
#registers
#delete
#paste
#normal-mode
How do I force Vim to check if open files were changed externally and reload them?
The :checktime command tells Vim to check whether any open buffers have been modified outside of Vim and prompt you to reload them.
category:
buffers-windows
tags:
#buffers
#ex-commands
#editing
How do I insert special Unicode characters and symbols using Vim's built-in digraph system?
Vim's digraph system lets you type hundreds of special characters — arrows, fractions, accented letters, currency symbols, and more — using intuitive two-ch
category:
editing
tags:
#insert-mode
#editing
How do I convert all hexadecimal numbers to decimal in Vim?
:%s/0x\x\+/\=str2nr(submatch(0), 16)/g
When cleaning logs, protocol dumps, or generated code, you may need to normalize 0x.
category:
editing
tags:
#editing
#ex-commands
#formatting
#search
How do I add line numbers to multiple lines using visual block?
Visual block insert can add numbered prefixes to lines.
category:
visual-mode
tags:
#visual-mode
#editing
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 enable syntax-based completion without plugins using completefunc?
:set completefunc=syntaxcomplete#Complete
If omnifunc is unavailable for a filetype, Vim can still offer meaningful completion by using syntax groups.
category:
config
tags:
#config
#completion
#insert-mode
#filetype
How do I auto-complete words in insert mode without any plugins?
Vim has a powerful built-in completion system that requires zero plugins.
category:
editing
tags:
#editing
#insert-mode
#completion
#productivity
How do I cycle through all lowercase marks in the current file sequentially?
The ]' command jumps to the start of the line containing the next lowercase mark in the file, while [' jumps to the previous one.
category:
navigation
tags:
#navigation
#marks
#normal-mode
How do I autocomplete file paths while typing in insert mode?
The command triggers filename completion in insert mode.
category:
editing
tags:
#editing
#insert-mode
#completion
#file-management
#productivity
How do I save my entire Vim workspace and restore it later?
:mksession / :source Session.vim
Vim's session feature saves a snapshot of your entire workspace — open buffers, window layout, tab pages, current directory, and more — to a file that you c
category:
buffers-windows
tags:
#buffers
#windows
#config
#productivity
#workflow
#session
How do I make Vim automatically change the working directory to the file I'm editing?
The autochdir option tells Vim to automatically change the current working directory to the directory of the file in the active window whenever you switch buffe
category:
config
tags:
#config
#navigation
#ex-commands
#buffers
How do I scroll the view horizontally so the cursor sits at the leftmost or rightmost visible column?
When nowrap is set and lines extend beyond the screen width, zs and ze snap the horizontal scroll position so the cursor sits exactly at the left or right edge
category:
navigation
tags:
#navigation
#scrolling
How do I make the active window automatically expand to take up most of the screen?
:set winheight=999 winminheight=5
Setting winheight to a very large number forces Vim to always try to make the focused window as tall as possible.
category:
buffers-windows
tags:
#buffers
#windows
#config
#navigation
How do I sort lines in Vim without caring about upper or lower case?
By default, :sort uses byte-value ordering, which places all uppercase letters before lowercase.
category:
command-line
tags:
#editing
#ex-commands
#command-line
How do I navigate by WORD boundaries that include punctuation in Vim?
How it works Vim distinguishes between two types of word objects: A word (lowercase w, b, e) is a sequence of letters, digits, and underscores, or a sequence of
category:
navigation
tags:
#navigation
#motions
#normal-mode