How do I reformat a paragraph or motion to fit within the text width without moving my cursor?
The gw operator reformats text to fit within textwidth, just like gq — but with one key difference: gw leaves the cursor in its original position after format
category:
editing
tags:
#editing
#formatting
#text-objects
#normal-mode
How do I convert a visually selected block of text to uppercase or lowercase?
In visual mode, pressing U converts all selected characters to uppercase and u converts them to lowercase.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I make the tilde key work as a case-toggle operator so I can use motions like ~w or ~ip?
By default, ~ toggles the case of a single character and advances the cursor.
category:
config
tags:
#editing
#config
#normal-mode
How do I prevent cursor movement in insert mode from splitting the undo block?
inoremap <Left> <C-g>U<Left>
In insert mode, any cursor movement — including arrow keys, Home, and End — causes Vim to split the undo block at that point.
category:
editing
tags:
#insert-mode
#undo-redo
#editing
How do I create a custom operator that works with motions and text objects?
:set operatorfunc=MyFunc<CR>g@
Vim lets you define custom operators that behave like built-in ones (d, c, y) — they wait for a motion or text object, then act on the selected region.
category:
config
tags:
#config
#normal-mode
#motions
#text-objects
#mapping
How do I convert selected text to uppercase?
In visual mode, pressing U converts all selected text to uppercase.
category:
visual-mode
tags:
#visual-mode
#editing
How do I make Vim display partial key sequences and selected character counts in real time?
The showcmd option makes Vim display the currently-typed command in the bottom-right corner of the screen, giving you live feedback as you build up key sequence
category:
config
tags:
#config
#normal-mode
#visual-mode
How do I yank text from the cursor to the next occurrence of a pattern without entering visual mode?
Any operator in Vim can take a search motion as its argument.
category:
editing
tags:
#editing
#search
#motions
#normal-mode
How do I jump to just before a specific character on the current line?
The t{char} command moves the cursor forward to the character just before the next occurrence of {char} on the current line.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I delete through the end of the next search match from the cursor?
When you need to remove text up to a known marker, a plain search motion is often almost right but stops at the start of the match.
category:
navigation
tags:
#navigation
#search
#motions
#editing
How do I delete text from the cursor to the next occurrence of a pattern?
Vim lets you use a / search as a motion for any operator.
category:
editing
tags:
#editing
#search
#motions
#delete
#normal-mode
How do I jump to the start or end of a C-style block comment in Vim?
When editing code, you often need to navigate to the boundaries of multi-line block comments (/ .
category:
navigation
tags:
#navigation
#motions
#normal-mode
#search
How do I execute a single normal mode command without leaving insert mode?
Pressing in insert mode lets you execute one normal mode command and then automatically returns you to insert mode.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
#productivity
How do I jump to any visible word or character on screen instantly in Vim?
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
category:
plugins
tags:
#plugins
#easymotion
#navigation
#motions
#jumping
How do I enter a mode where I select text and then typing immediately replaces the selection, like in most graphical editors?
Vim's Select mode behaves like the familiar selection model in most GUI editors: after selecting text, any printable character you type replaces the selection a
category:
visual-mode
tags:
#visual-mode
#select-mode
#editing
#normal-mode
How do I access the X11 primary selection (middle-click buffer) separately from the clipboard in Vim on Linux?
On X11 Linux systems, there are two independent clipboard-like buffers: the primary selection (") and the clipboard ("+).
category:
registers
tags:
#registers
#clipboard
#linux
#x11
#advanced
How do I jump to any visible text on screen with a two-character search using flash.nvim in Neovim?
flash.
category:
plugins
tags:
#navigation
#motions
#plugins
#search
How do I force any window-opening command to create a vertical split instead of horizontal?
The :vertical command modifier forces any window-opening Ex command to create a vertical split instead of the default horizontal split.
category:
buffers-windows
tags:
#windows
#buffers
#command-line
#splits
#ex-commands
How do I change text from the cursor up to a specific character?
The ct{char} command deletes everything from the cursor up to (but not including) the specified character and drops you into insert mode.
category:
editing
tags:
#editing
#motions
#normal-mode
#text-objects
#productivity
How do I visually select the next occurrence of my last search pattern?
The gn motion searches forward for the next match of the last search pattern and visually selects it.
category:
search
tags:
#navigation
#search
#motions
#normal-mode
#repeat
#editing