How do I change whether a register pastes as character, line, or block-wise?
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
261 results for ":b#"
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
<C-a> (command-line)
Pressing on the command line expands all current completion matches into the command at once, rather than cycling through them one at a time with .
:%s/pattern/\r/g
In the replacement part of :s, \r inserts a newline.
:set complete-=i
Vim's complete option controls which sources are scanned when you press or to complete a word.
<C-w>r
The r command rotates windows in the current row or column.
:set jumpoptions+=stack
By default, Vim's jumplist can feel surprising: if you jump backward and then make a new jump, the old forward path is not always discarded like a browser histo
:b3
Use :b followed by the buffer number.
<C-w>h / <C-w>j / <C-w>k / <C-w>l
How it works Vim lets you navigate between split windows using followed by a direction key.
o (in visual mode)
While in visual mode, pressing o swaps the cursor to the opposite end of the selection.
qaI// <Esc>jq
This macro adds a // comment prefix to the beginning of the current line and moves down.
:[range]g/pattern/command
The :global command accepts an optional line range prefix that restricts which lines it even considers matching.
:'a,'bs/old/new/g
Named marks can serve as range endpoints for any Ex command, including :substitute.
<C-w>| and <C-w>_ / <C-w>=
Vim lets you temporarily maximize a split window to full width or full height, and then restore all windows to equal sizes with =.
buffers-windows #windows #splits #navigation #productivity #layout
"ayy "byy "cyy
How it works Vim provides 26 named registers (a through z) that you can use as independent clipboards.
<C-w>H / <C-w>J / <C-w>K / <C-w>L
The H, J, K, and L commands move the current window to the far left, bottom, top, or right of the screen respectively, rearranging your entire split layout.
buffers-windows #windows #buffers #navigation #splits #layout
"ayy"byy
Yank the line twice into different registers.
:norm! {command}
:normal {command} runs a sequence of Normal mode keystrokes from the command line (or a range of lines with :%normal), but it applies your custom key mappings.
command-line #ex-commands #macros #normal-mode #command-line
:set nostartofline
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
:ls
The :ls command displays a list of all open buffers in Vim, showing their buffer number, status indicators, file name, and the line the cursor was last on.
<C-v>jjjg<C-a>
Selecting a column of identical numbers with visual block mode and pressing g turns them into an incrementing sequence.