Vi,Vim,NVim

Increasing or decreasing numbers

in: VimTip, Usage


Tip 30 Printable Monobook

In normal mode, typing Ctrl-A will increment the next number,
and typing Ctrl-X will decrement the next number.

and typing Ctrl-X will decrement the next number.

The number can be at the cursor, or to the right of the cursor (on the same line).

These are the defaults for Vim, although some scripts remap these keys to perform other functions.


Edit Share


Tip 30PrintableMonobookPreviousNext

created 2001 · complexity basic · version 7.0


In normal mode, typing Ctrl-A will increment the next number, and typing Ctrl-X will decrement the next number. The number can be at the cursor, or to the right of the cursor (on the same line). These are the defaults for Vim, although some scripts remap these keys to perform other functions.

These keys work with a count. For example, pressing 5 then Ctrl-A will increment the following number five times (add 5).

Laisser un commentaire