How do you change the root of the netrw tree in vim?

You can also use "gn" mapping to change the current directory to the folder under your cursor.

CHANGING TREE TOP netrw-ntree :Ntree netrw-gn {{{2

One may specify a new tree top for tree listings using

    :Ntree [dirname]

Without a "dirname", the current line is used (and any leading depth information is elided). With a "dirname", the specified directory name is used.

The "gn" map will take the word below the cursor and use that for changing the top of the tree listing.


quite old thread, but maybe someone find this information useful that currently you can use c to change to current dir.

If you want to always change pwd while browsing around with netrw you could use: let g:netrw_keepdir = 0


Per the documentation for netrw, use the ex command

:Ntree [dirname]

Assuming you have netrw installed, one can obtain more information on this using help

:help Ntree

Often times, I will just change the current work directory using the ex command

:cd [dirname]

Next, I start the explorer (ex command again)

:Exp

***Addendum***********

To update your version of netrw, I would just follow the directions that the author, Charles Campbell, posted on www.vim.org.

Tags:

Vim

Netrw