@@ -103,23 +103,35 @@ Setup should be run in a lua file or in a |lua-heredoc| if using in a vim file.
103
103
104
104
*:NvimTreeOpen*
105
105
106
- opens the tree. Takes an optional path argument.
106
+ Opens the tree. See | nvim-tree.api.tree.open() |
107
+
108
+ Calls: `api.tree.open({ path = "<arg> " })`
107
109
108
110
*:NvimTreeClose*
109
111
110
- closes the tree
112
+ Closes the tree. See | nvim-tree.api.tree.close() |
113
+
114
+ Calls: `api.tree.close ()`
111
115
112
116
*:NvimTreeToggle*
113
117
114
- open or close the tree. Takes an optional path argument.
118
+ Open or close the tree. See | nvim-tree.api.tree.toggle() |
119
+
120
+ Calls: `api.tree.toggle({ path = "<arg> " })`
115
121
116
122
*:NvimTreeFocus*
117
123
118
- open the tree if it is closed, and then focus on the tree
124
+ Open the tree if it is closed, and then focus on the tree.
125
+
126
+ See | nvim-tree.api.tree.toggle() |
127
+
128
+ Calls: `api.tree.focus ()`
119
129
120
130
*:NvimTreeRefresh*
121
131
122
- refresh the tree
132
+ Refresh the tree. See | nvim-tree.api.tree.reload() |
133
+
134
+ Calls: `api.tree.reload ()`
123
135
124
136
*:NvimTreeFindFile*
125
137
@@ -131,6 +143,10 @@ Setup should be run in a lua file or in a |lua-heredoc| if using in a vim file.
131
143
132
144
Invoke with a bang `:NvimTreeFindFile! ` to update the root.
133
145
146
+ See | nvim-tree.api.tree.find_file() |
147
+
148
+ Calls: `api.tree.find_file { open = true, update_root = <bang> }`
149
+
134
150
*:NvimTreeFindFileToggle*
135
151
136
152
close the tree or change the cursor in the tree for the current bufname,
@@ -139,10 +155,18 @@ Setup should be run in a lua file or in a |lua-heredoc| if using in a vim file.
139
155
140
156
Invoke with a bang `:NvimTreeFindFileToggle! ` to update the root.
141
157
158
+ See | nvim-tree.api.tree.toggle() |
159
+
160
+ Calls: `api.tree.toggle { find_file = true, focus = true, path = "<arg> ", update_root = <bang> }`
161
+
142
162
*:NvimTreeClipboard*
143
163
144
164
Print clipboard content for both cut and copy
145
165
166
+ See | nvim-tree.api.fs.print_clipboard() |
167
+
168
+ Calls: `api.fs .print_clipboard ()`
169
+
146
170
*:NvimTreeResize*
147
171
148
172
Resize the NvimTree window to the given size. Example: `:NvimTreeResize 50`
@@ -155,11 +179,19 @@ Setup should be run in a lua file or in a |lua-heredoc| if using in a vim file.
155
179
156
180
Collapses the nvim-tree recursively.
157
181
182
+ See | nvim-tree.api.tree.collapse_all() |
183
+
184
+ Calls: `api.tree.collapse_all (false)`
185
+
158
186
*:NvimTreeCollapseKeepBuffers*
159
187
160
188
Collapses the nvim-tree recursively, but keep the directories open, which are
161
189
used in an open buffer.
162
190
191
+ See | nvim-tree.api.tree.collapse_all() |
192
+
193
+ Calls: `api.tree.collapse_all (true)`
194
+
163
195
*:NvimTreeGenerateOnAttach*
164
196
165
197
Creates and opens a new file `/tmp/ my_on_attach.lua ` containing an
@@ -1266,7 +1298,8 @@ api.tree.open({opts}) *nvim-tree.api.tree.open()*
1266
1298
• {path} (string) root directory for the tree
1267
1299
• {current_window} (boolean, false) open the tree in the current window
1268
1300
• {find_file} (boolean, false) find the current buffer
1269
- • {update_root} (boolean, false) see | nvim-tree.update_focused_file.update_root |
1301
+ • {update_root} (boolean, false) requires {find_file}, see
1302
+ | nvim-tree.update_focused_file.update_root |
1270
1303
1271
1304
api.tree.toggle({opts} ) *nvim-tree.api.tree.toggle()*
1272
1305
Open or close the tree.
@@ -1278,7 +1311,8 @@ api.tree.toggle({opts}) *nvim-tree.api.tree.toggle()*
1278
1311
• {path} (string) root directory for the tree
1279
1312
• {current_window} (boolean, false) open the tree in the current window
1280
1313
• {find_file} (boolean, false) find the current buffer
1281
- • {update_root} (boolean, false) see | nvim-tree.update_focused_file.update_root |
1314
+ • {update_root} (boolean, false) requires {find_file}, see
1315
+ | nvim-tree.update_focused_file.update_root |
1282
1316
• {focus} (boolean, true) focus the tree when opening
1283
1317
1284
1318
api.tree.close() *nvim-tree.api.tree.close()*
@@ -1329,11 +1363,19 @@ api.tree.get_nodes() *nvim-tree.api.tree.get_nodes()*
1329
1363
Return: ~
1330
1364
table of nodes
1331
1365
1332
- api.tree.find_file({path} ) *nvim-tree.api.tree.find_file()*
1333
- Find and focus a file or folder in the tree.
1366
+ api.tree.find_file({opts} ) *nvim-tree.api.tree.find_file()*
1367
+ Find and focus a file or folder in the tree. Finds current buffer unless
1368
+ otherwise specified.
1334
1369
1335
1370
Parameters: ~
1336
- • {path} (string) absolute path
1371
+ • {opts} (table) optional parameters with boolean defaults
1372
+
1373
+ Options: ~
1374
+ • {buf} (string|number) absolute/relative path OR bufnr to find
1375
+ • {open} (boolean, false) open the tree
1376
+ • {current_window} (boolean, false) requires {open} , open in the current window
1377
+ • {update_root} (boolean, false) see | nvim-tree.update_focused_file.update_root |
1378
+ • {focus} (boolean, false) focus the tree
1337
1379
1338
1380
api.tree.search_node() *nvim-tree.api.tree.search_node()*
1339
1381
Open the search dialogue as per the search_node action.
0 commit comments