cd to folder when doing nvim FOLDER and layout code

- when doing `nvim FOLDER` it works as expected, opening the tree
on the correct folder (updating the ROOT_PATH)
- add the code for keeping the tree window on the side no matter
what, but since the lack of window events, disable this feature.
This commit is contained in:
kyazdani42
2020-02-28 00:59:57 +01:00
parent a6f4ec6270
commit f6e44c1726
4 changed files with 57 additions and 17 deletions

View File

@@ -12,6 +12,12 @@ au BufWritePost * lua require'tree'.refresh()
au BufEnter * lua require'tree'.check_windows_and_close()
au VimEnter * lua require'tree'.check_buffer_and_open()
" TODO: WinEnter is not the right autocommand for this task,
" but we do not have LayoutChange or WinMove kind of option atm,
" so this is deactivated by default to avoid messing up users workflows
" au WinEnter * lua require'tree'.replace_tree()
command! LuaTreeToggle lua require'tree'.toggle()
command! LuaTreeRefresh lua require'tree'.refresh()