GVim won't 'cd' to dropped file's dir

1 view
Skip to first unread message

Andrew

unread,
May 18, 2008, 11:06:49 AM5/18/08
to vim...@googlegroups.com
Is there a way to get GVim to auto-`cd` to a dropped file's directory?

My gripe is that when I `:sav` the edited file giving it a new name, it
ends up in my home directory, which *of course* is not what I'd want to
do.

I'm using version 7.0.237 on KDE 3.5 for Linux.

Thanks in advance,
Andrew


Andy Wokula

unread,
May 18, 2008, 12:16:48 PM5/18/08
to vim...@googlegroups.com
Andrew schrieb:

:h drag-n-drop
hold down Shift while dropping the file.

For similar situations, I need this often but not always, thus I mapped a function key to it:
:nn <F3> :cd %:p:h<cr>
:h ::p

If you want it always, set 'autochdir'
:h 'acd

--
Andy

Andrew

unread,
May 18, 2008, 1:05:16 PM5/18/08
to vim...@googlegroups.com
On Sun, 18 May 2008 18:16:48 +0200, Andy Wokula <anw...@yahoo.de> wrote:

> If you want it always, set 'autochdir'
> :h 'acd

That's exactly what I was looking for, thank you. Should be set by
default, IMHO.

Cheers,
Andrew


Tony Mechelynck

unread,
May 18, 2008, 5:43:11 PM5/18/08
to vim...@googlegroups.com

I tried it some time ago, and after some time I decided it wasn't so
cool after all, came back from it. Of course, YMMV.

Best regards,
Tony.
--
"What I've done, of course, is total garbage."
-- R. Willard, Pure Math 430a

Reply all
Reply to author
Forward
0 new messages