History Report a problem
Article Edit this page Discussion

$ instead of 4

From Vim Tips Wiki

Jump to: navigation, search
 

Tip 1527Previous TipNext 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

 

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"$ instead of 4"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation