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

  • Home
  • SEARCH
  • 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 7865089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:58:45+00:00 2026-06-02T23:58:45+00:00

I found the answer to this question while writing it, so I’ve broadened it

  • 0

I found the answer to this question while writing it, so I’ve broadened it a little. I wanted to access the --servername argument, in order to create dynamic settings in my .vimrc file.

Through vim’s help, I found the v:servername variable, and my script is working. However, now I’m curious if it’s possible to access any arbitrary command-line argument. For example, if I wanted to know if vim was in Lisp mode (-l) or Debugging mode (-D), how would I do it? There seems to be no corresponding v: variable for them.

Here are the variables I found by autocompleting :help v:<Tab>
enter image description here

Is there a general way to access command-line arguments from vimscript?

  • 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-06-02T23:58:47+00:00Added an answer on June 2, 2026 at 11:58 pm

    Strangely, I think the answer may be “No, there is no direct way to access startup options specified on the command line”.

    The :args command and argv() can be used to access the filename(s) specified on startup, but that’s not what you want.

    I see on Vim’s forums that someone offered this solution to get the startup command line on Linux:

    :exe '!tr "\0" " " </proc/' . getpid() . '/cmdline' 
    

    I assume there’s analogous command on Windows. . . .

    You can look over that forum thread here:

    http://groups.google.com/group/vim_use/browse_thread/thread/43773f27cdc10265/ad17ae8180c0fb6e?show_docid=ad17ae8180c0fb6e

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

Sidebar

Related Questions

(I found the answer to this elsewhere while writing the question, but I thought
While trying to answer this question I found that the code int* p =
While trying to answer this question I found without () (which invokes C++ most
This question nags me for a while but I did not found complete answer
While searching for an answer to this question I found this sample code which
I know this question has been posted before... but I haven't found any answer
I've been looking for an existing answer to this question, but haven't found one.
While I found this question being answered here on SW several times, I didn't
I found this question while i searched the usage of metaclass in python.It's a
This question might appear very simple, but i haven't found an answer yet, so

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.