How do I make Ctrl-A and Ctrl-X increment and decrement alphabetic characters?
:set nrformats+=alpha
By default, and only increment and decrement numbers (decimal, hex, and octal depending on format).
261 results for "visual mode"
:set nrformats+=alpha
By default, and only increment and decrement numbers (decimal, hex, and octal depending on format).
:let &t_SI = "\e[6 q"
Modern terminals support cursor shape changes via escape sequences.
gcc / gc{motion}
The vim-commentary plugin by Tim Pope provides a simple, operator-based way to comment and uncomment code.
<C-a> / <C-x>
Pressing increments and decrements the number under or after the cursor.
:GBrowse
The vim-fugitive plugin combined with vim-rhubarb (for GitHub support) provides the :GBrowse command, which opens the current file on your repository's web host
:'<,'>normal A;
The :normal command executes normal-mode keystrokes on every line in a range.
command-line #command-line #ex-commands #editing #normal-mode #batch-editing
:%s/pattern//gn
The n flag on the substitute command makes it report the match count without actually performing any replacement.
:'<,'>norm @q
When you visually select lines and then type a : command, Vim automatically inserts ' (the visual range marks) into the command line.
vaB
The aB text object (around Block) selects everything from the matching { to the closing } — including the braces themselves.
:'a,'b s/old/new/g
Marks can be used as range specifiers in any Ex command.
command-line #marks #command-line #ex-commands #ranges #editing
vis
The is (inner sentence) text object selects the sentence the cursor is in — excluding any leading or trailing whitespace that separates sentences.
\@=
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@ family of atoms.
&
The & command in normal mode repeats the last :s substitution on the current line.
search #search #substitution #ex-commands #repeat #normal-mode
:nnoremap / :inoremap / :vnoremap
Vim has two types of key mappings: recursive (:map, :nmap, :imap) and non-recursive (:noremap, :nnoremap, :inoremap).
zf{motion}
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
: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.
:sort /regex/
The :sort /pattern/ command sorts lines by the text that appears after the first match of a pattern, not from the start of each line.
:'<,'>norm {commands}
The :normal (or :norm) command lets you execute normal mode keystrokes from the command line.
command-line #editing #ex-commands #normal-mode #productivity #ranges
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
:set wrap! or :set nowrap
How it works By default, Vim wraps long lines that extend past the window width, displaying them across multiple screen lines.