File tree 3 files changed +30
-0
lines changed
3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1335,6 +1335,20 @@ exists.
1335
1335
- navigate.prev
1336
1336
- navigate.select
1337
1337
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
+
1338
1352
==============================================================================
1339
1353
6. MAPPINGS *nvim-tree-mappings*
1340
1354
Original file line number Diff line number Diff line change @@ -399,6 +399,18 @@ local DEFAULT_MAPPING_CONFIG = {
399
399
list = {},
400
400
}
401
401
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
+
402
414
function M .setup (opts )
403
415
require (" nvim-tree.actions.fs.trash" ).setup (opts )
404
416
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 = {
6
6
fs = { copy = {} },
7
7
git = {},
8
8
live_filter = {},
9
+ config = { mappings = {} },
9
10
}
10
11
11
12
local function inject_node (f )
@@ -127,4 +128,7 @@ Api.marks.navigate.next = require("nvim-tree.marks.navigation").next
127
128
Api .marks .navigate .prev = require (" nvim-tree.marks.navigation" ).prev
128
129
Api .marks .navigate .select = require (" nvim-tree.marks.navigation" ).select
129
130
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
+
130
134
return Api
You can’t perform that action at this time.
0 commit comments