How do I select a rectangular block past the end of shorter lines in visual block mode?
:set virtualedit=block
By default, Vim's visual block mode () is limited by line length — if some lines are shorter than others, the block selection gets ragged.
210 results for "insert mode"
:set virtualedit=block
By default, Vim's visual block mode () is limited by line length — if some lines are shorter than others, the block selection gets ragged.
<C-r><C-o>{register}
The standard {reg} pastes register contents in Insert mode, but Vim may auto-indent multi-line text to match the current indentation level — sometimes manglin
qaI<C-r>a<Esc>jq
Record a macro that inserts the contents of register a at the start of each line using a in insert mode, then moves down.
g; / g,
The g; and g, commands let you navigate Vim's changelist — a per-buffer history of every position where you made a change.
navigation #navigation #changelist #editing #normal-mode #marks
:nnoremap / :inoremap / :vnoremap
Vim has two types of key mappings: recursive (:map, :nmap, :imap) and non-recursive (:noremap, :nnoremap, :inoremap).
:echo @/
The / register holds the most recent search pattern.
:let i=1 then use <C-r>=i<CR> in macro
By combining a Vimscript variable with the expression register inside a macro, you can create a counter that increments on each replay.
`.
The ` .
:set paste
The :set paste command enables paste mode, which temporarily disables auto-indentation, smart tabs, and other insert-mode features that can mangle text pasted f
:.!sh
The :.
command-line #editing #ex-commands #shell #filtering #productivity
@=
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.
.
The .
"/
Vim stores the last search pattern in the special / register.
R
Replace mode lets you type over existing text one character at a time, like the "Insert" key behavior in traditional editors.
<C-v>jjc replacement<Esc>
Visual block mode's change command lets you replace a rectangular column of text across multiple lines in a single operation.
visual-mode #editing #visual-mode #block-mode #normal-mode #productivity
<C-v>I#<Esc>
Vim's Visual Block mode lets you prepend characters (like comment markers) to multiple lines simultaneously.
:let @a = system('cmd')
You can populate any Vim register with the output of an external shell command using :let @{register} = system('{command}').
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
v{motion}<C-g>
Vim has a lesser-known select mode that behaves like selection in typical GUI editors: any typed character replaces the selection.
<C-v>$A
When you need to append text to the end of several lines that have different lengths, visual block mode with $ is the key.