nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open tree for current buffer

harrisoncramer opened this issue · comments

First off, thank you for this awesome plugin! It's great.

Is it possible to configure the plugin so that the tree opens relative to the buffer's current location on your computer? For instance, I'll often originally open up nvim in ~/myfiles/folder/foo.js and within the same session, edit a file in a different directory, for example at ~/anotherfolder/different/bar.js. Currently, when inside that second directory, the tree opens within the original directory that nvim first opened in (the ~/myfiles/folder directory).

Is it possible to open the tree dynamically based on which buffer is currently focused?

au BufEnter * if &ft != 'help' | silent! cd %:p:h | endif

(actually, checking for 'help' filetype is not that necessary, I guess)

Thank you! Worked perfectly, alongside the vim_tree_respect_buf_cwd setting.