feat(api): add api.config.mappings.active, api.config.mappings.default (#1876)
* feat(api): add config.mappings.current and config.mappings.default * feat(api): add config.mappings.current and config.mappings.default * feat(api): add config.mappings.current and config.mappings.default
This commit is contained in:
committed by
GitHub
parent
cdbd7daf29
commit
bac962caf4
@@ -399,6 +399,18 @@ local DEFAULT_MAPPING_CONFIG = {
|
||||
list = {},
|
||||
}
|
||||
|
||||
--- clone default for the user
|
||||
--- @return table
|
||||
function M.default_mappings_clone()
|
||||
return vim.deepcopy(DEFAULT_MAPPINGS)
|
||||
end
|
||||
|
||||
--- clone active for the user
|
||||
--- @return table
|
||||
function M.active_mappings_clone()
|
||||
return vim.deepcopy(M.mappings)
|
||||
end
|
||||
|
||||
function M.setup(opts)
|
||||
require("nvim-tree.actions.fs.trash").setup(opts)
|
||||
require("nvim-tree.actions.node.system-open").setup(opts)
|
||||
|
||||
@@ -6,6 +6,7 @@ local Api = {
|
||||
fs = { copy = {} },
|
||||
git = {},
|
||||
live_filter = {},
|
||||
config = { mappings = {} },
|
||||
}
|
||||
|
||||
local function inject_node(f)
|
||||
@@ -127,4 +128,7 @@ Api.marks.navigate.next = require("nvim-tree.marks.navigation").next
|
||||
Api.marks.navigate.prev = require("nvim-tree.marks.navigation").prev
|
||||
Api.marks.navigate.select = require("nvim-tree.marks.navigation").select
|
||||
|
||||
Api.config.mappings.active = require("nvim-tree.actions").active_mappings_clone
|
||||
Api.config.mappings.default = require("nvim-tree.actions").default_mappings_clone
|
||||
|
||||
return Api
|
||||
|
||||
Reference in New Issue
Block a user