Bash alias to open Vim at last cursor position 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
16:43 UTC
Read the original article
Hit count: 513
The mark "
in Vim takes you to your last cursor 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 "'\""'
Well that's not going to work! You need to escape the first single quote you say...
$ alias v='vim -c "\'\""'
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