How do I force a motion to act blockwise, linewise, or characterwise?
Vim lets you override the natural type of any motion by pressing v, V, or between the operator and the motion.
category:
editing
tags:
#editing
#motions
#visual-mode
#advanced
#normal-mode
How do I filter text through an external program using a motion in normal mode?
The ! operator in normal mode lets you pipe a range of text through any external program and replace it with the output.
category:
editing
tags:
#editing
#normal-mode
#ex-commands
#formatting
How do I align text around a delimiter character using vim-lion?
vim-lion (by Tom McDonald) adds gl and gL as alignment operators.
category:
plugins
tags:
#plugins
#editing
#formatting
How do I delete from the cursor to the end of the line?
The D command deletes everything from the cursor position to the end of the current line.
category:
editing
tags:
#editing
#delete
#normal-mode
How do I jump backward by paragraph in Vim?
The { motion moves the cursor backward to the previous blank line, jumping to the beginning of the current or previous paragraph.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I create a custom operator that works with any motion in Vim?
:set operatorfunc=MyFunc<CR>g@{motion}
Vim's operatorfunc and g@ let you define custom operators that accept any motion or text object, just like built-in operators d, c, and y.
category:
config
tags:
#config
#mapping
#normal-mode
#editing
How do I create a custom Vim operator that works with any motion or text object?
Vim's operatorfunc option lets you define your own operators — just like the built-in d, y, or c — that accept any motion or text object.
category:
config
tags:
#config
#macros
#vimscript
#normal-mode
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 change the case of text using operators and motions?
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
category:
editing
tags:
#editing
#case
#operators
#text-objects
#normal-mode
How do I select text character by character in Vim?
The v command enters character-wise visual mode, letting you select text one character at a time.
category:
visual-mode
tags:
#visual-mode
#normal-mode
How do I copy from the cursor to the end of the line?
The y$ command yanks (copies) text from the cursor position to the end of the line.
category:
editing
tags:
#editing
#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 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 delete text without overwriting my yank register?
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
category:
registers
tags:
#registers
#editing
#delete
#normal-mode
How do I change surrounding quotes or brackets from one type to another with vim-surround?
The vim-surround plugin (by Tim Pope) adds three powerful operators for working with surrounding delimiters — quotes, brackets, parentheses, and HTML tags.
category:
plugins
tags:
#plugins
#text-objects
#editing
How do I jump forward by paragraph in Vim?
The } motion moves the cursor forward to the next blank line, effectively jumping to the next paragraph.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I jump forward by sentence in Vim?
The ) motion moves the cursor to the beginning of the next sentence.
category:
navigation
tags:
#navigation
#motions
#normal-mode
#text-objects
How do I delete from the cursor to the end of a word?
The de command deletes from the cursor position to the end of the current word.
category:
editing
tags:
#editing
#delete
#motions
#normal-mode
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
How do I yank text into a specific named register for later use?
Vim has 26 named registers (a-z) that act as independent clipboards.
category:
registers
tags:
#registers
#editing
#normal-mode
#yank
#productivity