On Apr 29, 3:12 am, Paul Isambert wrote: >AndyHancock a écrit: >> I posted previously about the fact that pwd returns different >> directories for different windows. I was pointed to autochdir, in >> particular: >> >> verbose set autochdir? >> >> which always returns noautochdir. >> >> I already have noautochdir in my vimrc, and the above command >> indicates that netrw was last to set the autochdir option. >> >> The problem is sporadic enough that it isn't clear to me that I >> will ever be able to figure out how/when autochdir is being set (if >> it is). > > The problem might not come from autochdir but from something like: > > autocmd BufRead * lcd %:p:h > > which sets the window’s local directory. Perhaps you have that > somewhere in your .vimrc file or elsewhere? (It’s common enough.)
It's not in my vimrc file. I used cygwin's bash to issue the following case-insensitive recursive search for the above statement from "/c/Program Files (x86)/Vim". grep -iR 'autocmd.*BufRead.*cd' !(Vimball) Nothing came up. I sanity checked the search command by ensuring that the following abbreviated version did yield (tons of) hits. grep -iR 'autocmd.*BufRead' !(Vimball) >> As an alternative to tracking this down, is there a way to prevent >> autochdir from being set at all? I mean even if a plugin or >> function somehwere issues a command to set autochdir, I want [g]vim >> to be incapable of complying. > > As far as I know, you can’t. But you can put a script in your > “after” directory, which simply contains: > > set noautochdir > > Scripts in “after” are loaded after plugins. What should I name the file? I was confused by the help file for "after". -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
