How do I quickly select an entire function body using visual mode?
The a{ (around braces) and i{ (inside braces) text objects combined with visual mode let you instantly select an entire function body or code block, regardless
category:
visual-mode
tags:
#visual-mode
#text-objects
#code-navigation
#selection
How do I move a column of text to a different position using visual block mode?
Visual block mode lets you select, cut, and paste rectangular columns of text.
category:
visual-mode
tags:
#visual-mode
#block-mode
#columns
#editing
How do I swap a word with the contents of a register using visual mode?
The viwp command visually selects the word under the cursor and replaces it with the contents of the unnamed register (your last yank or delete).
category:
visual-mode
tags:
#editing
#visual-mode
#registers
#paste
#productivity
How do I select text inside angle brackets?
The vi).
category:
visual-mode
tags:
#visual-mode
#text-objects
How do I see a live preview of substitutions as I type in Neovim?
Neovim's inccommand option provides real-time visual feedback as you type substitution commands.
category:
visual-mode
tags:
#visual-mode
#substitute
#neovim
#preview
How do I select all text inside square brackets?
The vi[ command selects the text inside square brackets without including the brackets themselves.
category:
visual-mode
tags:
#visual-mode
#text-objects
How do I append text to the end of multiple lines at once using visual block mode?
Visual block mode combined with $A lets you append text to the end of multiple lines simultaneously, even when those lines have different lengths.
category:
visual-mode
tags:
#editing
#visual-mode
#block-mode
#productivity
#insert-mode
How do I enable mouse support in Vim?
How it works The :set mouse=a command enables mouse support in all Vim modes.
category:
config
tags:
#navigation
#editing
How do I insert the same text on multiple lines at once?
Visual block mode combined with I lets you insert the same text at the beginning of multiple lines simultaneously.
category:
visual-mode
tags:
#visual-mode
#editing
#insert-mode
How do I yank and paste a vertical block of text using blockwise registers?
How it works Vim registers remember not just the text content but also the type of selection that was used to yank it: characterwise, linewise, or blockwise.
category:
registers
tags:
#registers
#visual-mode
#editing
How do I reformat a paragraph or visual selection to fit a specific line width?
The gq operator reformats text to fit within your configured textwidth.
category:
visual-mode
tags:
#visual-mode
#formatting
#editing
#text-objects
How do I join multiple lines together with a custom separator like a comma?
Vim's J command joins lines with a single space, but sometimes you need a custom separator like a comma, pipe, or semicolon.
category:
editing
tags:
#editing
#ex-commands
#visual-mode
#substitution
#lines
How do I write a visual selection to a separate file in Vim?
How it works Vim's :w command can take a range, and when used with a visual selection, it writes only the selected lines to a file.
category:
visual-mode
tags:
#visual-mode
#ex-commands
#buffers
#editing
How do I select the text I just pasted or changed?
The ` [v] sequence visually selects the exact region of text that was last changed, pasted, or yanked into the buffer.
category:
visual-mode
tags:
#editing
#visual-mode
#marks
#paste
#productivity
How do I execute Vimscript code from the current buffer?
:source % or :'<,'>source
The :source command executes Vimscript from a file.
category:
command-line
tags:
#command-line
#vimscript
#workflow
#development
How do I visually select from the cursor to the matching bracket or parenthesis?
How it works The % motion jumps to the matching bracket, parenthesis, or brace.
category:
visual-mode
tags:
#visual-mode
#navigation
#motions
#editing
How do I move selected lines down in the file?
The :m command with the visual range moves selected lines.
category:
visual-mode
tags:
#visual-mode
#editing
#ex-commands
How do I comment out multiple lines at once in Vim without a plugin?
Vim's Visual Block mode lets you prepend characters (like comment markers) to multiple lines simultaneously.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I select or operate on the entire buffer as a text object?
While Vim doesn't have a built-in "entire buffer" text object, the ggVG sequence achieves it: go to the first line, enter line-wise visual mode, then select to
category:
editing
tags:
#editing
#text-objects
#visual-mode
#normal-mode
How do I filter a visual selection through an external shell command?
How it works Vim can pipe selected text through any external shell command, replacing the selection with the command's output.
category:
visual-mode
tags:
#visual-mode
#ex-commands
#editing
#formatting