On 12/30/08, Tony Mechelynck wrote: > > On 30/12/08 12:30, François Ingelrest wrote: > > On Tue, Dec 30, 2008 at 12:17, Tony Mechelynck wrote: > >> Every time: > >> :set autochdir > >> > >> This will constantly change your working directory; the help says that > >> it may cause some plugins not to work. > > > > I used this option for some time, but eventually found that sometimes > > it does not work. I have been unable to find what triggers this bug, > > so I use a simple autocommand: > > > > au BufEnter * lcd %:p:h > > > > This proved to work flawlessly.
I found a different sort of problem entirely: some things would break because it changes working directory when plugins working expecting it! Limiting it to a non-nested autocmd helps to limit how often the directory changes, and is *much* nicer to plugins. > With :lcd, triggering on BufRead,BufNewFile ought to be enough. No. :lcd sets the working directory for the window. With BufEnter, the working directory for the window gets changed when doing a :bp, and with BufRead,BufNewFile it doesn't. ~Matt --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
