How do I use Vim as an inline calculator with the expression register?
<C-r>=expression<CR>
The expression register ("=) evaluates Vimscript expressions and returns the result.
registers #registers #insert-mode #expression #calculator #vimscript
170 results for ":help"
<C-r>=expression<CR>
The expression register ("=) evaluates Vimscript expressions and returns the result.
registers #registers #insert-mode #expression #calculator #vimscript
:Telescope live_grep
Telescope's livegrep picker provides real-time regex search across your entire project as you type.
Use :s/pat/rep/e flag or :silent! prefix
By default, Vim macros abort on the first error — a failed search, a substitute with no matches, or a movement that can't be performed.
Write keystrokes in buffer, then "qy$
Instead of recording a macro in real-time (where mistakes mean starting over), you can write the keystrokes as text in a buffer, edit them visually, and then ya
macros #macros #editing #registers #workflow #best-practices
:colorscheme name
The :colorscheme command changes the visual theme of Vim.
:set nobackup noswapfile
Disabling backup and swap files prevents Vim from creating extra files alongside your source code.
:autocmd Event pattern command
Autocommands let you execute commands automatically in response to events like opening a file, saving, or changing buffers.
qa f,ldt,F(p q
This macro swaps two comma-separated arguments inside parentheses by cutting the second argument and placing it before the first.
:UndotreeToggle
The undotree plugin provides a visual tree representation of Vim's undo history.
gF
The gF command opens the file under the cursor and jumps to the line number that appears after the filename.
:tabnew / gt / gT
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
buffers-windows #buffers #windows #tabs #navigation #productivity
:set sessionoptions+=globals
By default, :mksession restores windows, buffers, and many editor states, but it skips most global variables.
:Explore
Netrw is Vim's built-in file explorer plugin that comes with every Vim installation.
[* and ]*
The [ and ] motions (also written as [/ and ]/) let you jump directly to the opening / or closing / of a C-style block comment.
:set {option}&
Append & to any :set command to reset that option to its compiled-in default value — the value Vim shipped with before any vimrc or plugin changed it.
d<C-v>2j
Vim lets you override the natural type of any motion by pressing v, V, or between the operator and the motion.
editing #editing #motions #visual-mode #advanced #normal-mode
:setlocal nobuflisted
Setting nobuflisted removes a buffer from the :ls output and buffer-switching commands like :bnext/:bprev, while keeping it loaded and accessible.
buffers-windows #buffers-windows #buffers #unlisted #management
/\%>80v\S
When you enforce line-length limits, visual guides show where the boundary is, but they do not help you jump directly to violations.
:verbose nmap <lhs>
When key behavior is inconsistent, the root cause is usually mapping precedence.
command-line #command-line #mappings #debugging #config #normal-mode
<C-k>{digraph}
Vim's digraph system lets you insert special characters, accented letters, and symbols by typing a memorable two-character sequence.