add Gitignore (#251)

This commit is contained in:
peach lasagna
2021-03-31 01:11:25 +07:00
committed by GitHub
parent 709d6b968b
commit eadead6072
5 changed files with 42 additions and 0 deletions

View File

@@ -100,6 +100,21 @@ end
local function gen_ignore_check()
local ignore_list = {}
local function add_toignore(path)
local content = utils.read_file(path)
for s in content:gmatch("[^\r\n]+") do
ignore_list[s] = true
end
end
if (vim.g.nvim_tree_gitignore or 0) > 0 then
add_toignore('.gitignore')
end
if (vim.g.nvim_tree_gitignore or 0) == 2 then
add_toignore(git.get_path_gitexclude())
end
if vim.g.nvim_tree_ignore and #vim.g.nvim_tree_ignore > 0 then
for _, entry in pairs(vim.g.nvim_tree_ignore) do
ignore_list[entry] = true