#857 add filter_custom action, filter_ignored->filter_git_ignored (#1077)

This commit is contained in:
Alexander Courtis
2022-03-18 21:30:30 +11:00
committed by GitHub
parent b136c7b6f9
commit a50fd77c99
6 changed files with 33 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ local M = {
{ key = "<Tab>", action = "preview" },
{ key = "K", action = "first_sibling" },
{ key = "J", action = "last_sibling" },
{ key = "I", action = "toggle_ignored" },
{ key = "I", action = "toggle_git_ignored" },
{ key = "H", action = "toggle_dotfiles" },
{ key = "R", action = "refresh" },
{ key = "a", action = "create" },
@@ -46,6 +46,7 @@ local M = {
{ key = "S", action = "search_node" },
{ key = ".", action = "run_file_command" },
{ key = "<C-k>", action = "toggle_file_info" },
{ key = "U", action = "toggle_custom" },
},
custom_keypress_funcs = {},
}
@@ -79,7 +80,8 @@ local keypress_funcs = {
system_open = require("nvim-tree.actions.system-open").fn,
toggle_dotfiles = require("nvim-tree.actions.toggles").dotfiles,
toggle_help = require("nvim-tree.actions.toggles").help,
toggle_ignored = require("nvim-tree.actions.toggles").ignored,
toggle_custom = require("nvim-tree.actions.toggles").custom,
toggle_git_ignored = require("nvim-tree.actions.toggles").git_ignored,
trash = require("nvim-tree.actions.trash").fn,
}

View File

@@ -5,8 +5,13 @@ local reloaders = require "nvim-tree.actions.reloaders"
local M = {}
function M.ignored()
filters.config.filter_ignored = not filters.config.filter_ignored
function M.custom()
filters.config.filter_custom = not filters.config.filter_custom
return reloaders.reload_explorer()
end
function M.git_ignored()
filters.config.filter_git_ignored = not filters.config.filter_git_ignored
return reloaders.reload_explorer()
end