Quantcast

pwd seems to depend on the window

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

pwd seems to depend on the window

Paul-2
The newest version of gvim for Windows seems to have different present-
working-directories for each window.  Is there anyway to have the old
behaviour, where if I do ":cd %:p:h" on one window to get to the
containing folder, the pwd will stay in that folder when I switch to
another window/buffer?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: pwd seems to depend on the window

John Beckett-2
Paul wrote:
> The newest version of gvim for Windows seems to have
> different present- working-directories for each window.  Is
> there anyway to have the old behaviour, where if I do ":cd
> %:p:h" on one window to get to the containing folder, the pwd
> will stay in that folder when I switch to another window/buffer?

I don't see a problem. These commands can be used:
    :cd %:p:h
    :lcd %:p:h

The first sets Vim's current directory for all windows.
The second sets it only for the current window.

Check autochdir value:
    :verbose set autochdir?

If there is a problem, start with
    gvim -N -u NONE

then work out some simple commands that illustrate a problem,
and post them and the result.

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: pwd seems to depend on the window

Paul-2
Will do...as soon as I find the circumstances that gave rise to the
problem.  It doesn't always seem to exhibit itself.

On May 11, 8:28 pm, "John Beckett" <[hidden email]> wrote:

> Paul wrote:
> > The newest version of gvim for Windows seems to have
> > different present- working-directories for each window.  Is
> > there anyway to have the old behaviour, where if I do ":cd
> > %:p:h" on one window to get to the containing folder, the pwd
> > will stay in that folder when I switch to another window/buffer?
>
> I don't see a problem. These commands can be used:
>     :cd %:p:h
>     :lcd %:p:h
>
> The first sets Vim's current directory for all windows.
> The second sets it only for the current window.
>
> Check autochdir value:
>     :verbose set autochdir?
>
> If there is a problem, start with
>     gvim -N -u NONE
>
> then work out some simple commands that illustrate a problem,
> and post them and the result.
>
> John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: pwd seems to depend on the window

Ben Fritz
On Friday, May 11, 2012 8:41:20 PM UTC-5, Paul wrote:
> Will do...as soon as I find the circumstances that gave rise to the
> problem.  It doesn't always seem to exhibit itself.
>

I know on Windows, Vim sometimes changes directories to the file's path when passed an absolute path to the file. I don't remember the circumstances in which this happens, or whether the directory change is local or global, and I can't find the help reference at the moment. I think it's designed for drag-n-drop, which is also invoked by the --remote series of commands, if that helps you reproduce. You can scour the help if you need the exact circumstances.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Loading...