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 8554577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:54:51+00:00 2026-06-11T14:54:51+00:00

when I open gvim using Alt+F2 it takes as its default working directory my

  • 0

when I open gvim using Alt+F2 it takes as its default working directory my home folder.

How can I change the working folder after or while running gvim? can i pass that folder as a parameter when open gvim?

  • 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-11T14:54:53+00:00Added an answer on June 11, 2026 at 2:54 pm

    You could use a shortcut.

    The simplest way, though, would be to

    :edit $MYVIMRC
    

    append a line

    cd /home/user/my/work/dir
    

    save (optionally execute :w|source % to immediately reload)


    Inside vim

    use

    :pwd
    :cd some/other/dir
    

    To view/change current working directory.

    Use e.g.

    :cd %:h
    

    to change to the directory containing the file loaded in the active window.
    If you need/want to do this often, consider just setting ‘autochdir’

    :se autochdir
    

    From the docs:

    When on, Vim will change the current working directory
    whenever you open a file, switch buffers, delete a
    buffer or open/close a window.  It will change to the
    directory containing the file which was opened or
    selected.  This option is provided for backward
    compatibility with the Vim released with Sun ONE
    Studio 4 Enterprise Edition.
    

    Note: When this option is on some plugins may not work.

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

Sidebar

Related Questions

I can open a gvim session and drag&drop a folder while holding the shift
Open Ankh seems to be using Subversion 1.6.2 and Tortoise uses Subversion 1.6.0. After
I am using MacVim (basically gvim for the mac). If I open macvim from
I can open file at a specific line in mvim (on OSX, gvim on
I've been using gVim for a while now on my Windows box, and I
Trying to run gvim 7.3 from the working directory (project location) seems impossible-- it
I'm using gvim. Using vimgrep on current directory to find text across *.sql files.
This is what I want to do using GVIM 7.3: open a file in
open message box and long click on a message , as you can see
I am using the css_color.vim script with gvim 7.2 on vista. Because of this

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.