Refacto: rewrite everything

- The tree is created with libuv functions, which makes it blazingly fast.
- The tree may now be faster than any other vim trees, it can handle directories with thousands of files without any latency at all (tested on 40K files, works flawlessly).
- More solid logic for opening and closing the tree.
- tree state is remembered (closing / opening a folder keeps opened subdirectories open)
- detection of multiple git projects in the tree
- more icon support
- smart rendering
- smart updates
- ms windows support
- gx replacement function running xdg-open on linux, open on macos
This commit is contained in:
kiyan42
2020-05-19 19:46:45 +02:00
parent afc86a9623
commit e0bfcb4a6f
18 changed files with 1169 additions and 1029 deletions

View File

@@ -10,32 +10,16 @@ hi def link LuaTreePopup Normal
augroup LuaTree
au BufWritePost * lua require'tree'.refresh()
if get(g:, 'lua_tree_auto_close') != 0
au BufEnter * lua require'tree'.check_windows_and_close()
endif
if get(g:, 'lua_tree_auto_open') != 0
au VimEnter * lua require'tree'.check_buffer_and_open()
endif
if get(g:, 'lua_tree_follow') != 0
au BufEnter * :LuaTreeFindFile
endif
au BufEnter * lua require'tree'.navigate_to_buffer_dir()
au BufEnter * lua require'tree'.buf_enter()
au VimEnter * lua require'tree'.on_enter()
au ColorScheme * lua require'tree'.reset_highlight()
augroup end
" 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! LuaTreeOpen lua require'tree'.open()
command! LuaTreeClose lua require'tree'.close()
command! LuaTreeToggle lua require'tree'.toggle()
command! LuaTreeRefresh lua require'tree'.refresh()
command! LuaTreeFindFile lua require'tree'.find()
command! LuaTreeFindFile lua require'tree'.find_file()
let &cpo = s:save_cpo
unlet s:save_cpo