7

I have checked this screenshot (list of nvim-tree commands):

But there seems to be no command to change the root of my tree. Also I am hoping to setup a convenient startup location but could not find how to do that either.

1
  • 1
    If one of the two solution fit your need may could validate one to make the question rest (you can validate your own solution two days after you posted it). Feb 22, 2023 at 15:31

2 Answers 2

14

You can use the command Ctrl+], it will do it.

2
  • 1
    Do you mean <C-]>? Jun 3, 2023 at 10:19
  • 1
    @Vivian - thank you - this is the answer!
    – Colin
    Jun 8, 2023 at 9:50
2

On NvChad the root of the nvim-tree is the current working directory. You can change with the :cd command.

On Windows you can set the working directory in the shortcut property of Neovim

During the Neovim session you can set the working directory to buffer parent folder with the command:

:cd %:h

You can make sure Neovim set the working directory automatically to the parent folde of the buffer file using the autochdir option:

:set autochdir

Ther are also plugins that set the working directory to the git root folder of your buffer project automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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