@@ -63,7 +63,7 @@ Requirements
63
63
==============================================================================
64
64
2. QUICK START *nvim-tree-quickstart*
65
65
66
- Setup should be run in a lua file or in a | lua-heredoc | if using in a vim file.
66
+ Setup should be run in a lua file or in a | lua-heredoc | if using in a vim file. >lua
67
67
68
68
-- examples for your init.lua
69
69
@@ -168,7 +168,7 @@ setup() function takes one optional argument: configuration table. If omitted
168
168
nvim-tree will be initialised with default configuration.
169
169
170
170
Subsequent calls to setup will replace the previous configuration.
171
- >
171
+ >lua
172
172
require("nvim-tree").setup { -- BEGIN_DEFAULT_OPTS
173
173
auto_reload_on_write = true,
174
174
disable_netrw = false,
@@ -393,6 +393,14 @@ Subsequent calls to setup will replace the previous configuration.
393
393
watcher = false,
394
394
},
395
395
},
396
+ experimental = {
397
+ async = {
398
+ copy_paste = false,
399
+ create_file = false,
400
+ remove_file = false,
401
+ rename_file = false,
402
+ }
403
+ }
396
404
} -- END_DEFAULT_OPTS
397
405
<
398
406
@@ -404,7 +412,7 @@ Completely disable netrw
404
412
405
413
It is strongly advised to eagerly disable netrw, due to race conditions at vim
406
414
startup.
407
- Set the following at the very beginning of your `init.lua ` / `init.vim ` : >
415
+ Set the following at the very beginning of your `init.lua ` / `init.vim ` : >lua
408
416
vim.g.loaded_netrw = 1
409
417
vim.g.loaded_netrwPlugin = 1
410
418
<
@@ -451,7 +459,7 @@ function.
451
459
- `name` : `string `
452
460
- `type ` : `" directory" ` | `" file" ` | `" link" `
453
461
454
- Example: sort by name length: >
462
+ Example: sort by name length: >lua
455
463
local sort_by = function(nodes)
456
464
table.sort(nodes, function(a, b)
457
465
return #a.name < #b.name
@@ -645,7 +653,7 @@ This can be used to attach keybindings to the tree buffer.
645
653
When on_attach is "disabled", it will use the older mapping strategy, otherwise it
646
654
will use the newer one.
647
655
Type: `function (bufnr )` , Default: `" disable" `
648
- e.g. >
656
+ e.g. >lua
649
657
local api = require("nvim-tree.api")
650
658
651
659
local function on_attach(bufnr)
@@ -779,7 +787,7 @@ UI rendering setup
779
787
Type: `string ` or `function (root_cwd)` , Default: `" :~:s?$?/..?" `
780
788
781
789
Function is passed the absolute path of the root folder and should return a string.
782
- e.g. >
790
+ e.g. >lua
783
791
my_root_folder_label = function(path)
784
792
return ".../" .. vim.fn.fnamemodify(path, ":t")
785
793
end
@@ -1011,7 +1019,7 @@ Configuration for various actions.
1011
1019
The function should return the window id that will open the node,
1012
1020
or `nil` if an invalid window is picked or user cancelled the action.
1013
1021
Type: `string ` | `function ` , Default: `" default" `
1014
- e.g. s1n7ax/nvim-window-picker plugin: >
1022
+ e.g. s1n7ax/nvim-window-picker plugin: >lua
1015
1023
window_picker = {
1016
1024
enable = true,
1017
1025
picker = require('window-picker').pick_window,
@@ -1133,6 +1141,18 @@ Configuration for diagnostic logging.
1133
1141
| nvim-tree.filesystem_watchers | processing, verbose.
1134
1142
Type: `boolean ` , Default: `false`
1135
1143
1144
+ *nvim-tree.experimental*
1145
+ Configuration for experimental features.
1146
+
1147
+ *nvim-tree.experimental.async*
1148
+ Control experimental async behavior.
1149
+
1150
+ *nvim-tree.experimental.async.copy_paste*
1151
+ Toggle async behavior of copy paste operation.
1152
+ Type: `boolean ` , Default: `false`
1153
+
1154
+ TODO here
1155
+
1136
1156
==============================================================================
1137
1157
4.1 VINEGAR STYLE *nvim-tree-vinegar*
1138
1158
@@ -1143,8 +1163,8 @@ it in a specific way:
1143
1163
1144
1164
- Use `require" nvim-tree" .open_replacing_current_buffer ()` instead of the
1145
1165
default open command.
1146
- You can easily implement a toggle using this too:
1147
- >
1166
+ You can easily implement a toggle using this too: >lua
1167
+
1148
1168
local function toggle_replace()
1149
1169
local view = require"nvim-tree.view"
1150
1170
local api = require"nvim-tree.api"
@@ -1156,8 +1176,8 @@ You can easily implement a toggle using this too:
1156
1176
end
1157
1177
<
1158
1178
- Use the `edit_in_place` action to edit files. It's bound to `<C-e> ` by
1159
- default, vinegar uses `<CR> ` . You can override this with:
1160
- >
1179
+ default, vinegar uses `<CR> ` . You can override this with: >lua
1180
+
1161
1181
require"nvim-tree".setup {
1162
1182
view = {
1163
1183
mappings = {
@@ -1178,8 +1198,8 @@ A good functionality to enable is |nvim-tree.hijack_directories|.
1178
1198
5. API *nvim-tree-api*
1179
1199
1180
1200
Nvim-tree's public API can be used to access features.
1181
- >
1182
- e.g. >
1201
+
1202
+ e.g. >lua
1183
1203
local api = require("nvim-tree.api")
1184
1204
api.tree.toggle()
1185
1205
<
@@ -1299,7 +1319,7 @@ Setting your own mapping in the configuration will soon be deprecated, see
1299
1319
Default `' n' ` .
1300
1320
1301
1321
Examples:
1302
- >
1322
+ >lua
1303
1323
local function print_node_path(node)
1304
1324
print(node.absolute_path)
1305
1325
end
@@ -1381,7 +1401,7 @@ DEFAULT MAPPINGS *nvim-tree-default-mappings
1381
1401
`m ` toggle_mark Toggle node in bookmarks
1382
1402
`bmv` bulk_move Move all bookmarked nodes into specified location
1383
1403
1384
- >
1404
+ >lua
1385
1405
view.mappings.list = { -- BEGIN_DEFAULT_MAPPINGS
1386
1406
{ key = { "<CR> ", "o", "<2-LeftMouse> " }, action = "edit" },
1387
1407
{ key = "<C-e> ", action = "edit_in_place" },
@@ -1443,7 +1463,7 @@ All the following highlight groups can be configured by hand. Aside from
1443
1463
groups.
1444
1464
1445
1465
Example (in your `init.vim ` ):
1446
- >
1466
+ >vim
1447
1467
highlight NvimTreeSymlink guifg=blue gui=bold,underline
1448
1468
<
1449
1469
You should have 'termguicolors' enabled, otherwise, colors will not be
@@ -1533,7 +1553,7 @@ to |nvim_tree_registering_handlers| for more information.
1533
1553
Handlers are registered by calling | nvim-tree-api | `events.subscribe`
1534
1554
function with an `events.Event` kind.
1535
1555
1536
- e.g. handler for node renamed: >
1556
+ e.g. handler for node renamed: >lua
1537
1557
local api = require("nvim-tree.api")
1538
1558
local Event = api.events.Event
1539
1559
@@ -1594,11 +1614,10 @@ To get the list of marked paths, you can call
1594
1614
Navigation for marks is not bound by default in nvim-tree because we don't
1595
1615
want to focus the tree view each time we wish to switch to another mark.
1596
1616
1597
- This requires binding bookmark navigation yourself.
1598
-
1599
- -- in your lua configuration
1600
- vim.keymap.set("n", "<leader> mn", require("nvim-tree.api").marks.navigate.next)
1601
- vim.keymap.set("n", "<leader> mp", require("nvim-tree.api").marks.navigate.prev)
1602
- vim.keymap.set("n", "<leader> ms", require("nvim-tree.api").marks.navigate.select)
1603
-
1617
+ This requires binding bookmark navigation yourself. >lua
1618
+ -- in your lua configuration
1619
+ vim.keymap.set("n", "<leader> mn", require("nvim-tree.api").marks.navigate.next)
1620
+ vim.keymap.set("n", "<leader> mp", require("nvim-tree.api").marks.navigate.prev)
1621
+ vim.keymap.set("n", "<leader> ms", require("nvim-tree.api").marks.navigate.select)
1622
+ <
1604
1623
vim:tw=78:ts=4:sw=4:et:ft=help:norl:
0 commit comments