Skip to content
Alexander Courtis edited this page Apr 16, 2023 · 12 revisions

Create A Directory

You can add a directory by adding a / at the end of the path.

Entering multiple directories BASE/foo/bar/baz will add directory foo, then bar and add a file baz to it.

Change Window Options

You can update tree local window options for the tree by setting

require("nvim-tree.view").View.winopts.MY_OPTION = MY_OPTION_VALUE

Open On The Left

If you :set nosplitright, the files will open on the left side of the tree, placing the tree window in the right side of the file you opened.

Hide .git Directory

You can hide the .git folder via a custom filter, see :help nvim-tree.filters.custom

filters = { custom = { "^.git$" } }

Disable Icons

To disable the display of icons see :help nvim-tree.renderer.icons.show

Netrw Keeps Popping Up

Eagerly disable Netrw: :help nvim-tree.disable_netrw

Fixing vertical split in windows terminal

Windows terminal uses ctrl-v for paste which conflicts with the default mapping for vertical split in nvim-tree resulting in the following error: Error executing lua: vim/_editor.lua:0: Vim:E21: Cannot make changes, 'modifiable' is off^@stack traceback:^@^I[C]: in function 'nvim_put'^@^Ivim/_editor.lua: in function <vim/_editor.lua:0> when trying to perform a vertical split. This can be fixed by remapping paste in windows terminal.

Go to Windows Terminal Settings -> Actions and then change the mapping for paste from ctrl-v to ctrl-shift-v.