Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 713519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:58:13+00:00 2026-05-14T04:58:13+00:00

The mark in Vim takes you to your last cursor position. I want to

  • 0

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?

Edit

In fact there is a better way to do this :h last-position-jump.

This autocommand jumps to the last known position in a file just after opening it, if the '" mark is set:

:au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:58:14+00:00Added an answer on May 14, 2026 at 4:58 am

    This looks completely obscure, but should work:

    alias v='vim -c "'"'"'\""'
    

    That’s a single-quoted vim -c ", followed by a double-quoted ', followed by a single-quoted \""…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In vim, often I will jump to a mark I made, or a search
I want to be able to open Vim and automatically make some commands in
I have a simple vim script that takes a visual block of text and
A feature I often use in Vim is m ark and jump-to-mark ( '
I want to mark all maxima along a given axis of an array (which
How can I mark a portion of a tkinter text widget as readonly? That
I'd like to mark some specific properties in a foreign assembly that i'm referencing
How can I make the vim column (:set cursor column) to be of a
I want to mark checkboxes if they have been selected via existing data from
I wonder how to mark a specific test in eunit in a way that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.