@@ -228,8 +228,8 @@ via |nvim-tree.on_attach| e.g. >
228
228
api.config.mappings.default_on_attach(bufnr)
229
229
230
230
-- custom mappings
231
- vim.keymap.set('n', ' <C-t>' , api.tree.change_root_to_parent, opts('Up' ))
232
- vim.keymap.set('n', '?' , api.tree.toggle_help, opts(' Help' ))
231
+ vim.keymap.set("n", " <C-t>" , api.tree.change_root_to_parent, opts("Up" ))
232
+ vim.keymap.set("n", "?" , api.tree.toggle_help, opts(" Help" ))
233
233
end
234
234
235
235
-- pass to setup along with your other options
@@ -1505,7 +1505,7 @@ Configuration options for opening a file from nvim-tree.
1505
1505
e.g. s1n7ax/nvim-window-picker plugin: >
1506
1506
window_picker = {
1507
1507
enable = true,
1508
- picker = require(' window-picker' ).pick_window,
1508
+ picker = require(" window-picker" ).pick_window,
1509
1509
<
1510
1510
*nvim-tree.actions.open_file.window_picker.chars*
1511
1511
A string of chars used as identifiers by the window picker.
@@ -2278,27 +2278,27 @@ The `on_attach` function is passed the `bufnr` of nvim-tree. Use
2278
2278
| vim.keymap.set() | or | nvim_set_keymap() | to define mappings as usual. e.g. >
2279
2279
2280
2280
local function my_on_attach(bufnr)
2281
- local api = require(' nvim-tree.api' )
2281
+ local api = require(" nvim-tree.api" )
2282
2282
2283
2283
local function opts(desc)
2284
- return { desc = ' nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
2284
+ return { desc = " nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
2285
2285
end
2286
2286
2287
2287
-- copy default mappings here from defaults in next section
2288
- vim.keymap.set('n', ' <C-]>' , api.tree.change_root_to_node, opts('CD' ))
2289
- vim.keymap.set('n', ' <C-e>' , api.node.open.replace_tree_buffer, opts(' Open: In Place' ))
2288
+ vim.keymap.set("n", " <C-]>" , api.tree.change_root_to_node, opts("CD" ))
2289
+ vim.keymap.set("n", " <C-e>" , api.node.open.replace_tree_buffer, opts(" Open: In Place" ))
2290
2290
---
2291
2291
-- OR use all default mappings
2292
2292
api.config.mappings.default_on_attach(bufnr)
2293
2293
2294
2294
-- remove a default
2295
- vim.keymap.del('n', ' <C-]>' , { buffer = bufnr })
2295
+ vim.keymap.del("n", " <C-]>" , { buffer = bufnr })
2296
2296
2297
2297
-- override a default
2298
- vim.keymap.set('n', ' <C-e>' , api.tree.reload, opts(' Refresh' ))
2298
+ vim.keymap.set("n", " <C-e>" , api.tree.reload, opts(" Refresh" ))
2299
2299
2300
2300
-- add your mappings
2301
- vim.keymap.set('n', '?' , api.tree.toggle_help, opts(' Help' ))
2301
+ vim.keymap.set("n", "?" , api.tree.toggle_help, opts(" Help" ))
2302
2302
---
2303
2303
end
2304
2304
@@ -2318,13 +2318,13 @@ Single right / middle mouse mappings will require changes to |mousemodel| or |mo
2318
2318
define your own function to map complex functionality e.g. >
2319
2319
2320
2320
local function print_node_path()
2321
- local api = require(' nvim-tree.api' )
2321
+ local api = require(" nvim-tree.api" )
2322
2322
local node = api.tree.get_node_under_cursor()
2323
2323
print(node.absolute_path)
2324
2324
end
2325
2325
2326
2326
-- on_attach
2327
- vim.keymap.set('n', ' <C-P>' , print_node_path, opts(' Print Path' ))
2327
+ vim.keymap.set("n", " <C-P>" , print_node_path, opts(" Print Path" ))
2328
2328
<
2329
2329
==============================================================================
2330
2330
7.1 MAPPINGS: DEFAULT *nvim-tree-mappings-default*
@@ -2334,10 +2334,10 @@ will be applied.
2334
2334
2335
2335
You are encouraged to copy these to your own | nvim-tree.on_attach | function.
2336
2336
>
2337
- local api = require(' nvim-tree.api' )
2337
+ local api = require(" nvim-tree.api" )
2338
2338
2339
2339
local function opts(desc)
2340
- return { desc = ' nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
2340
+ return { desc = " nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
2341
2341
end
2342
2342
2343
2343
-- BEGIN_DEFAULT_ON_ATTACH
@@ -2405,10 +2405,10 @@ Alternatively, you may apply these default mappings from your |nvim-tree.on_atta
2405
2405
| nvim-tree-api.config.mappings.default_on_attach() | e.g.
2406
2406
>
2407
2407
local function my_on_attach(bufnr)
2408
- local api = require(' nvim-tree.api' )
2408
+ local api = require(" nvim-tree.api" )
2409
2409
2410
2410
local function opts(desc)
2411
- return { desc = ' nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
2411
+ return { desc = " nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
2412
2412
end
2413
2413
2414
2414
api.config.mappings.default_on_attach(bufnr)
0 commit comments