Somewhere on Shadow Earth, at Fri, Jan 12, 2007 at 03:45:26AM +0100,
A.J.Mechelynck wrote:
<snip>
> Alternately, you can use
>
> :autocmd BufWinEnter * lcd %:p:h
>
> which will set a "local directory" for each buffer. This alternative only
> requires +autocmd, which is included in "Normal", "Big" and "Huge" builds
> of Vim.
>
> Personally, I've tried it, and I've found that I don't like directory
> changes happening, so to speak, "behind my back". I prefer that directories
> only be changed when I use ":cd" or ":lcd" explicitly. (YMMV)
Whereas I added that to my .vimrc some time ago, and absolutely love it. On the
other hand, I work on a large software development project with many deep
directory hierarchies (the Real Networks media server, most of the code for
which is open source, so you can see what I mean), and I find it *very* handy to
do something like this:
$ cd server/protocol/transport/rdt/unittest
$ vim ut_rdttcptran.cpp
<from within vim>
:e ../../../tools/unittest/netio/ut_socket.cpp
<later>
:e ut_bufsock.cpp (which is in the same dir as ut_socket.cpp)
<still later, after flipping back to ut_rdttcptran.cpp>
:e ut_rdtudptran.cpp (which is in the same dir as ut_rdttcptran.cpp)
I find that far more convenient than having to constantly remember to preface my
:e with a bunch of "../"'s, but, as noted, YMMV.
--
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone.
-- Bjarne Stroustrup, creator of the C++ programming language