Use the Counts to does simple arithmetic
In vim, execution <C-a>
and <C-x>
commands can be added or reduced directly to the numbers in the text.
If you do not provide a number to directly execute the above command, the default is to add 1 or minus 1 of the numeric value of the cursor.
If you precede the command with a number, it will add or subtract the number of the cursor.
If the cursor is in a position other than a number, the number is automatically searched after the current line and then positioned on that number.
As the following test file
We're going to copy the last line and then 0px
change it -180px
.
You can use commands in addition to making changes directly to numbers <C-x>
.
yy
command to copy the current line and p
paste it to the next line.
cW
The command removes the characters from the cursor to the next word first character, and then enters insert mode, which the user enters. New
180<C-x>
There is no number at the cursor position at execution time, automatically finds the current line, finds the position of the number 0 on the 0px , and subtracts 0 by 190.
[Practical.vim (2012.9)]. DREW.NEIL.TIP10 Study Summary