> I'd like vim to set the current working directory to that of the file
> I am editing when that file is opened. (This is convenient if I open
> the file by double clicking, say.)
> 
> Should be easy enough to do with an autocommand. But I haven't been
> able to find out how I can determine what the directory of the current
> buffer is. Does anyone know this offhand? Thanks!

It sounds like you simply want

   :set autochdir

which you can read about at

   :help 'autochdir'

However, to get the file name/path of the current file (just for 
future reference), mess around with

   expand('%:p:h')

which you can read up at

   :help expand()

-tim



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to