add better doc and add user ignore list

This commit is contained in:
kiyan42
2020-02-20 23:19:16 +01:00
parent 3527a67a9e
commit f28dbfa998
4 changed files with 91 additions and 10 deletions

View File

@@ -17,8 +17,19 @@ end
local Tree = {}
local IGNORE_LIST = ""
if api.nvim_call_function('exists', { 'g:lua_tree_ignore' }) == 1 then
local ignore_patterns = api.nvim_get_var('lua_tree_ignore')
if type(ignore_patterns) == 'table' then
for _, pattern in pairs(ignore_patterns) do
IGNORE_LIST = IGNORE_LIST .. '--ignore='..pattern..' '
end
end
end
local function list_dirs(path)
local ls_cmd = 'ls -A --ignore=.git ' ..path
local ls_cmd = 'ls -A '..IGNORE_LIST..path
return syslist(ls_cmd)
end