Search code examples
vimnetrw

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


The title sums it up, really. I'd like to know how to set the current root of the tree when browsing files using netrw in vim.

Any ideas?


Solution

  • 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.