Friday, September 21, 2012

increment character under cursor

Hi:
I was wondering if it was possible for Vim to increment the character I have selected under the cursor, rather than the whole number. For example, let's say I have a line like this:

margin-bottom: 30px;

I want it to be 40px instead. If I place my cursor over the '3' then hit CTRL-A, I get '31' and the cursor moves to the '1'. I want to increment the individual digit. (I realize in this case I could simply enter 'r4', but I'm curious about this method as it could be applicable for macros as well).

A second, and related, question, is it possible to get CTRL-A & CTRL-X to move in bigger jumps? Like rather than 1 unit a time, it'd be nice to hit CTRL-SHIFT-A to move 10 units at a time. I tried this mapping, but it doesn't seem to work:

nmap <S-C-A> 10<C-A>

Thanks. -JP

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment