Bash alias to open Vim at last edit mark

Posted by Pierre LaFayette on Stack Overflow See other posts from Stack Overflow or by Pierre LaFayette
Published on 2010-04-13T15:39:41Z Indexed on 2010/04/13 15:43 UTC
Read the original article Hit count: 557

Filed under:
|
|
|
|

The mark " in Vim takes you to your last edit position. I want to create an alias that will open my Vim instance and jump to that mark; something which is obviously extremely useful.

This works from the command line:

$ vim -c "'\"" File.cpp

Now I want to make an alias for this:

$ alias v='vim -c "'\"" File.cpp'

Well that's not going to work! You need to escape the first single quote you say...

$ alias v='vim -c "\'\"" File.cpp'

Hmm. That didn't work either... So I try a whole lot of variations of single quoted and double quoted madness, bang my head against the table and load up stackoverflow in my browser, and here we are.

How do I properly escape this alias?

© Stack Overflow or respective owner

Related posts about unix

Related posts about bash