How do I change the cursor shape to a thin bar in insert mode and a block in normal mode in Neovim?
:set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20
Neovim's guicursor option lets you assign a distinct cursor shape and style to each mode, providing immediate visual feedback about which mode you are in.
category:
config
tags:
#config
#normal-mode
#insert-mode
#visual-mode
How do I insert the same text at the start (or end) of multiple lines simultaneously?
<C-v>{motion}I{text}<Esc>
Visual block mode () lets you select a rectangular region across multiple lines.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I allow block selections past end-of-line while still permitting one-char past EOL cursor movement?
:set virtualedit=block,onemore
virtualedit controls whether the cursor can move to positions that do not yet contain text.
category:
config
tags:
#config
#visual-mode
#blockwise
#editing
#cursor
How do I select an HTML tag and its contents in Vim?
The vat command visually selects the nearest enclosing HTML or XML tag and all of its contents, including the opening and closing tags themselves.
category:
visual-mode
tags:
#visual-mode
#text-objects
#editing
#normal-mode
How do I make right-click extend a selection instead of opening a popup menu?
If you use the mouse occasionally in Vim, mousemodel=extend makes selection behavior much more predictable.
category:
config
tags:
#config
#visual-mode
#selection
#mouse
How do I incrementally expand or shrink a selection based on syntax tree nodes using nvim-treesitter?
nvim-treesitter's incremental selection module lets you grow and shrink your visual selection one syntax node at a time.
category:
plugins
tags:
#visual-mode
#plugins
#text-objects
#editing
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 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 visually select a double-quoted string including the quotes themselves?
Vim's text objects let you select structured regions of text with two-keystroke shortcuts.
category:
visual-mode
tags:
#visual-mode
#text-objects
#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 return to normal mode from absolutely any mode in Vim?
While works to leave insert or visual mode, it does not work in every situation — particularly in terminal mode (:terminal), where is consumed by the running
category:
navigation
tags:
#normal-mode
#insert-mode
#visual-mode
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 visually select an entire sentence in Vim?
The vas command visually selects the current sentence, including surrounding whitespace.
category:
visual-mode
tags:
#visual-mode
#text-objects
#motions
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 reflow or hard-wrap a paragraph to a set text width in Vim?
The vipgq sequence reflowing a paragraph to fit within the width defined by textwidth (default 0, meaning no limit).
category:
visual-mode
tags:
#visual-mode
#editing
#formatting
#text-objects
How do I execute a macro from bottom to top over a selected range?
Running a macro over a range usually goes top to bottom, but that can break when the macro inserts or deletes lines.
category:
macros
tags:
#macros
#ex-commands
#visual-mode
#normal-mode
#refactoring
How do I center, right-justify, or left-justify lines of text in Vim without a plugin?
:'<,'>center / :'<,'>right / :'<,'>left
Vim has built-in Ex commands to align text within a specified width: :center, :right, and :left.
category:
editing
tags:
#editing
#visual-mode
#formatting
#ex-commands
How do I select an entire paragraph in Vim?
The vip command visually selects the inner paragraph — all contiguous non-blank lines surrounding the cursor.
category:
visual-mode
tags:
#visual-mode
#text-objects
#editing
#normal-mode