$ instead of 4
From Vim Tips Wiki
Tip 1527 • Previous Tip • Next Tip
Created: November 2, 2007 Complexity: basic Author: V silent Version: 7.0
I'm a PHP developer, and sometimes I make typing mistakes like this:
$var = "sometext"; echo 4var;
That is, I pressed '4' instead of '$'.
I use the following map so I can quickly fix this problem by typing ,, while still on the same line.
map ,, F4r$A
Others may prefer
map ,, m`F4r$`` imap ,, <Esc>m`F4r$``a
for it returns where the cursor was. Useful when you are editing the middle of a line, with the cursor after the '4'.
[edit] Comments
Categories: VimTip | PHP
