File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1335,6 +1335,20 @@ exists.
13351335 - navigate.prev
13361336 - navigate.select
13371337
1338+ api.config.mappings.active() *nvim-tree.api.config.mappings.active()*
1339+ Retrieve a clone of the currently active mappings:
1340+ | nvim-tree-default-mappings | with | nvim-tree.view.mappings | applied.
1341+ Changing the active mappings will require a call to | nvim-tree-setup |
1342+
1343+ Return: ~
1344+ (table) as per | nvim-tree.view.mappings.list |
1345+
1346+ api.config.mappings.default() *nvim-tree.api.config.mappings.default()*
1347+ Retrieve a clone of the default mappings: | nvim-tree-default-mappings |
1348+
1349+ Return: ~
1350+ (table) as per | nvim-tree.view.mappings.list |
1351+
13381352==============================================================================
13391353 6. MAPPINGS *nvim-tree-mappings*
13401354
Original file line number Diff line number Diff line change @@ -399,6 +399,18 @@ local DEFAULT_MAPPING_CONFIG = {
399399 list = {},
400400}
401401
402+ --- clone default for the user
403+ --- @return table
404+ function M .default_mappings_clone ()
405+ return vim .deepcopy (DEFAULT_MAPPINGS )
406+ end
407+
408+ --- clone active for the user
409+ --- @return table
410+ function M .active_mappings_clone ()
411+ return vim .deepcopy (M .mappings )
412+ end
413+
402414function M .setup (opts )
403415 require (" nvim-tree.actions.fs.trash" ).setup (opts )
404416 require (" nvim-tree.actions.node.system-open" ).setup (opts )
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ local Api = {
66 fs = { copy = {} },
77 git = {},
88 live_filter = {},
9+ config = { mappings = {} },
910}
1011
1112local function inject_node (f )
@@ -127,4 +128,7 @@ Api.marks.navigate.next = require("nvim-tree.marks.navigation").next
127128Api .marks .navigate .prev = require (" nvim-tree.marks.navigation" ).prev
128129Api .marks .navigate .select = require (" nvim-tree.marks.navigation" ).select
129130
131+ Api .config .mappings .active = require (" nvim-tree.actions" ).active_mappings_clone
132+ Api .config .mappings .default = require (" nvim-tree.actions" ).default_mappings_clone
133+
130134return Api
You can’t perform that action at this time.
0 commit comments