Tuesday, December 25, 2012

Re: CTRL-A & CTRL-X backwards

Hey,

On 25.12.2012, at 12:10, Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:

On 24/12/12 02:55, stosss wrote:
*CTRL-A*
CTRL-A Add [count] to the number or alphabetic character at
or after the cursor.  {not in Vi}

*CTRL-X*
CTRL-X Subtract [count] from the number or alphabetic
character at or after the cursor.  {not in Vi}

These use to work as described from help but now they are doing the
opposite. I don't know how that happened.


From the answers you got, I see you weren't the first to fall into the same pitfall. Me too I was surprised the first time, and then after some seconds the penny fell and I realized that Vim cannot tell apart a dash (a "-" punctuation mark, as in 2012-12-25 or firefox-20.0a1) and a minus sign. I still occasionally fall into it, and then it's "Duh! I forgot that for Vim, a dash before a number makes the number negative".


Tim Pope created a Plugin[1] some Time ago, where he actually tried to fix this behavior by creating "Date" Patterns, witch recognize the dash correctly. Might be worth looking into



Merry Christmas!
Tony.

Merry Christmas,
Franz


No comments: