I'm in the browsing directory mode how can I change the current directory to that one I'm browsing? At least manually. But ":chdir ." doesn't work

Moreover, in the config file I have "set autochdir" and it still doesn't change it always automatically

  • 1
    the command is called :cd – Christian Brabandt Feb 17 '17 at 6:37
  • @ChristianBrabandt, doesn't work – Kolayn Feb 18 '17 at 10:23
  • Please be specific. What did you do, what did you expect, did you get an error message? – Christian Brabandt Feb 18 '17 at 19:39

The acd option should do what you want, you should describe, why and how it doesn't work.

I don't want the path change to happen automatically, so in my vimrc file, I have this:

"Switch to current dir
nnoremap <Leader>cd :cd %:p:h<cr>
  • how do you create a new file in the directory you're browsing? – Kolayn Feb 20 '17 at 1:57

Just type c. From :help netrw-c (or just execute :help netrw and search for directory):

By default, ... the current directory will not track the browsing directory. ... [I]n order to make the two directories the same, use the "c" map (just type c). That map will set Vim's notion of the current directory to netrw's current browsing directory.

For an acknowledgement of the 'autochdir' ('acd') problem, see:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.