Skip to content

Commit 2b5ab07

Browse files
committed
doc(#2934): tidy and nvim_tree.Config top level
1 parent 7c69cb5 commit 2b5ab07

2 files changed

Lines changed: 129 additions & 102 deletions

File tree

doc/nvim-tree-lua.txt

Lines changed: 82 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,96 +3450,88 @@ Lua module: nvim_tree *nvim-tree-module*
34503450
*nvim_tree.Config*
34513451

34523452
Fields: ~
3453-
• {on_attach}? (`string|fun(bufnr: integer)`)
3454-
• {auto_reload_on_write}? (`boolean`) Reloads the
3455-
explorer every time a buffer is
3456-
written to. Default: `true`
3457-
• {disable_netrw}? (`boolean`) Completely disable
3458-
netrw Default: `false`
3459-
• {hijack_cursor}? (`boolean`) Keeps the cursor on
3460-
the first letter of the
3461-
filename when moving in the
3462-
tree. Default: `false`
3463-
• {hijack_netrw}? (`boolean`) Hijack netrw
3464-
windows (overridden if
3465-
|disable_netrw| is `true`)
3466-
Default: `true`
3467-
• {hijack_unnamed_buffer_when_opening}? (`boolean`) Opens in place of
3468-
the unnamed buffer if it's
3469-
empty. Default: `false`
3470-
• {prefer_startup_root}? (`boolean`) Prefer startup root
3471-
directory when updating root
3472-
directory of the tree. Only
3473-
relevant when
3474-
`update_focused_file.update_root`
3475-
is `true` Default: `false` @see
3476-
nvim-tree.update_focused_file.update_root
3477-
• {reload_on_bufenter}? (`boolean`) Automatically
3478-
reloads the tree on `BufEnter`
3479-
nvim-tree. Default: `false`
3480-
• {respect_buf_cwd}? (`boolean`) Will change cwd of
3481-
nvim-tree to that of new
3482-
buffer's when opening
3483-
nvim-tree. Default: `false`
3484-
• {select_prompts}? (`boolean`) Use |vim.ui.select|
3485-
style prompts. Necessary when
3486-
using a UI prompt decorator
3487-
such as dressing.nvim or
3488-
telescope-ui-select.nvim
3489-
Default: `false`
3490-
• {sync_root_with_cwd}? (`boolean`) Changes the tree
3491-
root directory on `DirChanged`
3492-
and refreshes the tree.
3493-
Default: `false`
3494-
• {root_dirs}? (`string[]`) Preferred root
3495-
directories. Only relevant when
3496-
`update_focused_file.update_root`
3497-
is `true` Default: `{}` @see
3498-
nvim-tree.update_focused_file.update_root
3499-
{experimental}? (`table`) Experimental features
3500-
that may become default or
3501-
optional functionality. In the
3502-
event of a problem please
3503-
disable the experiment and
3504-
raise an issue.
3505-
{sort}? (`nvim_tree.Config.Sort`)
3506-
|nvim_tree.Config.Sort|
3507-
{view}? (`nvim_tree.Config.View`)
3508-
|nvim_tree.Config.View|
3509-
{renderer}? (`nvim_tree.Config.Renderer`)
3510-
|nvim_tree.Config.Renderer|
3511-
• {hijack_directories}? (`nvim_tree.Config.HijackDirectories`)
3512-
|nvim_tree.Config.HijackDirectories|
3513-
• {update_focused_file}? (`nvim_tree.Config.UpdateFocusedFile`)
3514-
|nvim_tree.Config.UpdateFocusedFile|
3515-
• {system_open}? (`nvim_tree.Config.SystemOpen`)
3516-
|nvim_tree.Config.SystemOpen|
3517-
{git}? (`nvim_tree.Config.Git`)
3518-
|nvim_tree.Config.Git|
3519-
{diagnostics}? (`nvim_tree.Config.Diagnostics`)
3520-
|nvim_tree.Config.Diagnostics|
3521-
{modified}? (`nvim_tree.Config.Modified`)
3522-
|nvim_tree.Config.Modified|
3523-
{filters}? (`nvim_tree.Config.Filters`)
3524-
|nvim_tree.Config.Filters|
3525-
• {live_filter}? (`nvim_tree.Config.LiveFilter`)
3526-
|nvim_tree.Config.LiveFilter|
3527-
• {filesystem_watchers}? (`nvim_tree.Config.FilesystemWatchers`)
3528-
|nvim_tree.Config.FilesystemWatchers|
3529-
{actions}? (`nvim_tree.Config.Actions`)
3530-
|nvim_tree.Config.Actions|
3531-
{trash}? (`nvim_tree.Config.Trash`)
3532-
|nvim_tree.Config.Trash|
3533-
{tab}? (`nvim_tree.Config.Tab`)
3534-
|nvim_tree.Config.Tab|
3535-
{notify}? (`nvim_tree.Config.Notify`)
3536-
|nvim_tree.Config.Notify|
3537-
{help}? (`nvim_tree.Config.Help`)
3538-
|nvim_tree.Config.Help|
3539-
{ui}? (`nvim_tree.Config.UI`)
3540-
|nvim_tree.Config.UI|
3541-
{log}? (`nvim_tree.Config.Log`)
3542-
|nvim_tree.Config.Log|
3453+
• {on_attach}? (`string|fun(bufnr: integer)`) Runs when
3454+
creating the nvim-tree buffer. Use this to
3455+
set your nvim-tree specific mappings. See
3456+
|nvim-tree-mappings|. When `on_attach` is not
3457+
a function, |nvim-tree-mappings-default| will
3458+
be called.
3459+
• {hijack_cursor}? (`boolean`, default: `false`) Keeps the
3460+
cursor on the first letter of the filename
3461+
when moving in the tree.
3462+
• {auto_reload_on_write}? (`boolean`, default: `true`) Reloads the
3463+
explorer every time a buffer is written to.
3464+
• {disable_netrw}? (`boolean`, default: `false`) Completely
3465+
disable |netrw|, see |nvim-tree-netrw| for
3466+
details. It is strongly advised to eagerly
3467+
disable netrw, due to race conditions at vim
3468+
startup.
3469+
• {hijack_netrw}? (`boolean`, default: `true`) Hijack netrw
3470+
windows, ignored when `disable_netrw` is
3471+
`true`
3472+
{hubwo}? (`boolean`, default: `false`) Opens in place
3473+
of the unnamed buffer if it's empty. TODO
3474+
reinstate this one when formatting is done
3475+
#2934 --@field
3476+
hijack_unnamed_buffer_when_opening? boolean
3477+
• {root_dirs}? (`string[]`) Preferred root directories. Only
3478+
relevant when
3479+
|nvim_tree.Config.UpdateFocusedFile|
3480+
`update_root` is `true`
3481+
• {prefer_startup_root}? (`boolean`, default: `false`) Prefer startup
3482+
root directory when updating root directory
3483+
of the tree. Only relevant when
3484+
|nvim_tree.Config.UpdateFocusedFile|
3485+
`update_root` is `true`
3486+
• {sync_root_with_cwd}? (`boolean`, default: `false`) Changes the
3487+
tree root directory on |DirChanged| and
3488+
refreshes the tree.
3489+
• {reload_on_bufenter}? (`boolean`, default: `false`) Automatically
3490+
reloads the tree on |BufEnter| nvim-tree.
3491+
• {respect_buf_cwd}? (`boolean`, default: `false`) Change cwd of
3492+
nvim-tree to that of new buffer's when
3493+
opening nvim-tree.
3494+
• {select_prompts}? (`boolean`, default: `false`) Use
3495+
|vim.ui.select| style prompts. Necessary when
3496+
using a UI prompt decorator such as
3497+
dressing.nvim or telescope-ui-select.nvim
3498+
{sort}? (`nvim_tree.Config.Sort`)
3499+
|nvim_tree.Config.Sort|
3500+
{view}? (`nvim_tree.Config.View`)
3501+
|nvim_tree.Config.View|
3502+
{renderer}? (`nvim_tree.Config.Renderer`)
3503+
|nvim_tree.Config.Renderer|
3504+
• {hijack_directories}? (`nvim_tree.Config.HijackDirectories`)
3505+
|nvim_tree.Config.HijackDirectories|
3506+
• {update_focused_file}? (`nvim_tree.Config.UpdateFocusedFile`)
3507+
|nvim_tree.Config.UpdateFocusedFile|
3508+
• {system_open}? (`nvim_tree.Config.SystemOpen`)
3509+
|nvim_tree.Config.SystemOpen|
3510+
{git}? (`nvim_tree.Config.Git`)
3511+
|nvim_tree.Config.Git|
3512+
{diagnostics}? (`nvim_tree.Config.Diagnostics`)
3513+
|nvim_tree.Config.Diagnostics|
3514+
{modified}? (`nvim_tree.Config.Modified`)
3515+
|nvim_tree.Config.Modified|
3516+
{filters}? (`nvim_tree.Config.Filters`)
3517+
|nvim_tree.Config.Filters|
3518+
• {live_filter}? (`nvim_tree.Config.LiveFilter`)
3519+
|nvim_tree.Config.LiveFilter|
3520+
• {filesystem_watchers}? (`nvim_tree.Config.FilesystemWatchers`)
3521+
|nvim_tree.Config.FilesystemWatchers|
3522+
{actions}? (`nvim_tree.Config.Actions`)
3523+
|nvim_tree.Config.Actions|
3524+
{trash}? (`nvim_tree.Config.Trash`)
3525+
|nvim_tree.Config.Trash|
3526+
{tab}? (`nvim_tree.Config.Tab`)
3527+
|nvim_tree.Config.Tab|
3528+
{notify}? (`nvim_tree.Config.Notify`)
3529+
|nvim_tree.Config.Notify|
3530+
{help}? (`nvim_tree.Config.Help`)
3531+
|nvim_tree.Config.Help|
3532+
{ui}? (`nvim_tree.Config.UI`) |nvim_tree.Config.UI|
3533+
{log}? (`nvim_tree.Config.Log`)
3534+
|nvim_tree.Config.Log|
35433535

35443536
*nvim_tree.Config.Actions*
35453537

lua/nvim-tree/_meta/config.lua

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,54 @@ error("Cannot require a meta file")
2020
--
2121

2222
---@class nvim_tree.Config
23+
---
24+
---Runs when creating the nvim-tree buffer. Use this to set your nvim-tree specific mappings. See |nvim-tree-mappings|. When `on_attach` is not a function, |nvim-tree-mappings-default| will be called.
2325
---@field on_attach? string|fun(bufnr: integer)
24-
---@field auto_reload_on_write? boolean Reloads the explorer every time a buffer is written to. Default: `true`
25-
---@field disable_netrw? boolean Completely disable netrw Default: `false`
26-
---@field hijack_cursor? boolean Keeps the cursor on the first letter of the filename when moving in the tree. Default: `false`
27-
---@field hijack_netrw? boolean Hijack netrw windows (overridden if |disable_netrw| is `true`) Default: `true`
28-
---@field hijack_unnamed_buffer_when_opening? boolean Opens in place of the unnamed buffer if it's empty. Default: `false`
29-
---@field prefer_startup_root? boolean Prefer startup root directory when updating root directory of the tree. Only relevant when `update_focused_file.update_root` is `true` Default: `false` @see nvim-tree.update_focused_file.update_root
30-
---@field reload_on_bufenter? boolean Automatically reloads the tree on `BufEnter` nvim-tree. Default: `false`
31-
---@field respect_buf_cwd? boolean Will change cwd of nvim-tree to that of new buffer's when opening nvim-tree. Default: `false`
32-
---@field select_prompts? boolean Use |vim.ui.select| style prompts. Necessary when using a UI prompt decorator such as dressing.nvim or telescope-ui-select.nvim Default: `false`
33-
---@field sync_root_with_cwd? boolean Changes the tree root directory on `DirChanged` and refreshes the tree. Default: `false`
34-
---@field root_dirs? string[] Preferred root directories. Only relevant when `update_focused_file.update_root` is `true` Default: `{}` @see nvim-tree.update_focused_file.update_root
35-
---@field experimental? table Experimental features that may become default or optional functionality. In the event of a problem please disable the experiment and raise an issue.
26+
---
27+
---Keeps the cursor on the first letter of the filename when moving in the tree.
28+
---(default: `false`)
29+
---@field hijack_cursor? boolean
30+
---
31+
---Reloads the explorer every time a buffer is written to.
32+
---(default: `true`)
33+
---@field auto_reload_on_write? boolean
34+
---
35+
---Completely disable |netrw|, see |nvim-tree-netrw| for details. It is strongly advised to eagerly disable netrw, due to race conditions at vim startup.
36+
---(default: `false`)
37+
---@field disable_netrw? boolean
38+
---
39+
---Hijack netrw windows, ignored when `disable_netrw` is `true`
40+
---(default: `true`)
41+
---@field hijack_netrw? boolean
42+
---
43+
---Opens in place of the unnamed buffer if it's empty.
44+
---(default: `false`)
45+
---TODO reinstate this one when formatting is done #2934
46+
-----@field hijack_unnamed_buffer_when_opening? boolean
47+
---@field hubwo? boolean
48+
---
49+
---Preferred root directories. Only relevant when |nvim_tree.Config.UpdateFocusedFile| `update_root` is `true`
50+
---@field root_dirs? string[]
51+
---
52+
---Prefer startup root directory when updating root directory of the tree. Only relevant when |nvim_tree.Config.UpdateFocusedFile| `update_root` is `true`
53+
---(default: `false`)
54+
---@field prefer_startup_root? boolean
55+
---
56+
---Changes the tree root directory on |DirChanged| and refreshes the tree.
57+
---(default: `false`)
58+
---@field sync_root_with_cwd? boolean
59+
---
60+
---Automatically reloads the tree on |BufEnter| nvim-tree.
61+
---(default: `false`)
62+
---@field reload_on_bufenter? boolean
63+
---
64+
---Change cwd of nvim-tree to that of new buffer's when opening nvim-tree.
65+
---(default: `false`)
66+
---@field respect_buf_cwd? boolean
67+
---
68+
---Use |vim.ui.select| style prompts. Necessary when using a UI prompt decorator such as dressing.nvim or telescope-ui-select.nvim
69+
---(default: `false`)
70+
---@field select_prompts? boolean
3671
---
3772
---|nvim_tree.Config.Sort|
3873
---@field sort? nvim_tree.Config.Sort

0 commit comments

Comments
 (0)