On 10/29/07, Dominique Pelle <[EMAIL PROTECTED]> wrote: > I have the following line in my .vimrc which does exactly what > you're looking for, and I find it very useful: > > autocmd BufEnter * exe 'cd ' . substitute(expand("%:p:h")," ", "\\\\ ", "g")
You might prefer this line: au BufEnter * if &ft != 'help' | silent! cd %:p:h | endif A bit shorter, less of that ugly \ escaping, and a special-case to make sure that it doesn't change directory when I don't want it to. ~Matt --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---