chore(doc): improve help by allowing accessing nested options (#1246)

This commit is contained in:
Kiyan 2022-05-09 08:59:09 +02:00 committed by GitHub
parent 9049f364cc
commit 47732b6dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 228 additions and 246 deletions

View File

@ -115,6 +115,7 @@ require'nvim-tree'.setup {
-- setup with all defaults -- setup with all defaults
-- each of these are documented in `:help nvim-tree.OPTION_NAME` -- each of these are documented in `:help nvim-tree.OPTION_NAME`
-- nested options are documented by accessing them with `.` (eg: `:help nvim-tree.view.mappings.list`).
require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS
auto_reload_on_write = true, auto_reload_on_write = true,
disable_netrw = false, disable_netrw = false,

View File

@ -205,138 +205,121 @@ As options are currently being migrated, configuration of global options in
Here is a list of the options available in the setup call: Here is a list of the options available in the setup call:
*nvim-tree.disable_netrw* *nvim-tree.disable_netrw*
- |disable_netrw|: completely disable netrw Completely disable netrw
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
*nvim-tree.hijack_netrw* *nvim-tree.hijack_netrw*
- |hijack_netrw|: hijack netrw windows (overriden if |disable_netrw| is `true`) Hijack netrw windows (overriden if |disable_netrw| is `true`)
type: `boolean` Type: `boolean`, Default: `true`
default: `true`
*nvim-tree.open_on_setup* *nvim-tree.open_on_setup*
- |open_on_setup|: will automatically open the tree when running setup if Will automatically open the tree when running setup if startup buffer is
startup buffer is a directory, is empty or is unnamed. nvim-tree window will a directory, is empty or is unnamed. nvim-tree window will be focused.
be focused. Type: `boolean`, Default: `false`
type: `boolean`
default: `false`
*nvim-tree.open_on_setup_file* *nvim-tree.open_on_setup_file*
- |open_on_setup_file|: will automatically open the tree when running setup if Will automatically open the tree when running setup if startup buffer is a file.
startup buffer is a file. File window will be focused. File will be found if File window will be focused.
|update_focused_file.enable| is set. File will be found if update_focused_file is enabled.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
*nvim-tree.ignore_buffer_on_setup* *nvim-tree.ignore_buffer_on_setup*
- |ignore_buffer_on_setup|: will ignore the buffer, when deciding to open the tree Will ignore the buffer, when deciding to open the tree on setup.
on setup Type: `boolean`, Default: `false`
type: `boolean`
default: `false`
*nvim-tree.ignore_ft_on_setup* *nvim-tree.ignore_ft_on_setup*
- |ignore_ft_on_setup|: list of filetypes that will make |open_on_setup| not List of filetypes that will make `open_on_setup` not open.
open. You can use this option if you don't want the tree to open in some You can use this option if you don't want the tree to open
scenarios (eg using vim startify). in some scenarios (eg using vim startify).
type: `{string}` Type: {string}, Default: {}
default: `{}`
*nvim-tree.auto_reload_on_write* *nvim-tree.auto_reload_on_write*
- |auto_reload_on_write|: reloads the explorer every time a buffer is written to Reloads the explorer every time a buffer is written to.
type: `boolean` Type: `boolean`, Default: `true`
default: `true`
*nvim-tree.open_on_tab* *nvim-tree.open_on_tab*
- |open_on_tab|: opens the tree automatically when switching tabpage or opening a new Opens the tree automatically when switching tabpage or opening a new tabpage
tabpage if the tree was previously open. if the tree was previously open.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
*nvim-tree.sort_by* *nvim-tree.sort_by*
- |sort_by|: changes how files within the same directory are sorted. can be Changes how files within the same directory are sorted.
one of 'name' | 'case_sensitive' | 'modification_time'. Can be one of 'name', 'case_sensitive' or 'modification_time'.
type: `string` Type: `string`, Default: `"name"`
default: `"name"`
*nvim-tree.hijack_unnamed_buffer_when_opening* *nvim-tree.hijack_unnamed_buffer_when_opening*
- |hijack_unnamed_buffer_when_opening|: opens in place of the unnamed Opens in place of the unnamed buffer if it's empty.
buffer if it's empty. Type: `boolean`, Default: `false`
type: `boolean`
default: `false`
*nvim-tree.hijack_directories*
- |hijack_directories|: hijacks new directory buffers when they are opened (`:e dir`).
- |hijack_directories.enable|: enable the feature. Disable this option if you
use vim-dirvish or dirbuf.nvim. If |hijack_netrw| and |disable_netrw| are
`false`, this feature will be disabled.
type: `boolean`
default: `true`
- |hijack_directories.auto_open|: opens the tree if the tree was previously closed.
type: `boolean`
default: `true`
*nvim-tree.hijack_cursor* *nvim-tree.hijack_cursor*
- |hijack_cursor|: keeps the cursor on the first letter of the filename when Keeps the cursor on the first letter of the filename when moving in the tree.
moving in the tree. Type: `boolean`, Default: `false`
type: `boolean`
default: `false`
*nvim-tree.update_cwd* *nvim-tree.update_cwd*
- |update_cwd|: changes the tree root directory on `DirChanged` and refreshes Changes the tree root directory on `DirChanged` and refreshes the tree.
the tree. Type: `boolean`, Default: `false`
type: `boolean`
default: `false` *nvim-tree.hijack_directories*
hijacks new directory buffers when they are opened (`:e dir`).
*nvim-tree.hijack_directories.enable*
Enable the feature.
Disable this option if you use vim-dirvish or dirbuf.nvim.
If `hijack_netrw` and `disable_netrw` are `false`, this feature will be disabled.
Type: `boolean`, Default: `true`
*nvim-tree.hijack_directories.auto_open*
Opens the tree if the tree was previously closed.
Type: `boolean`, Default: `true`
*nvim-tree.update_focused_file* *nvim-tree.update_focused_file*
- |update_focused_file|: update the focused file on `BufEnter`, un-collapses Update the focused file on `BufEnter`, un-collapses the folders recursively
the folders recursively until it finds the file until it finds the file.
- |update_focused_file.enable|: enable this feature. *nvim-tree.update_focused_file.enable*
type: `boolean` Enable this feature.
default: `false` Type: `boolean`, Default: `false`
- |update_focused_file.update_cwd|: update the root directory of the tree to the one *nvim-tree.update_focused_file.update_cwd*
of the folder containing the file if the file is not under the current root Update the root directory of the tree to the one of the folder containing
directory. Only relevant when |update_focused_file.enable| is `true` the file if the file is not under the current root directory.
type: `boolean` Only relevant when `update_focused_file.enable` is `true`
default: `false` Type: `boolean`, Default: `false`
- |update_focused_file.ignore_list|: list of buffer names and filetypes that will not *nvim-tree.update_focused_file.ignore_list*
update the root dir of the tree if the file isn't found under the current root List of buffer names and filetypes that will not update the root dir
directory. Only relevant when |update_focused_file.update_cwd| is `true` and of the tree if the file isn't found under the current root directory.
|update_focused_file.enable| is `true`. Only relevant when `update_focused_file.update_cwd` and
type: `{string}` `update_focused_file.enable` are `true`.
default: `{}` Type: {string}, Default: {}
*nvim-tree.system_open* *nvim-tree.system_open*
- |system_open|: configuration options for the system open command Configuration options for the system open command.
- |system_open.cmd|: the command to run, leaving empty should work but *nvim-tree.system_open.cmd*
useful if you want to override the default command with another one. The command to run, leaving empty should work but useful if you want to
type: `string` override the default command with another one.
default: `""` Type: `string`, Default: `""`
- |system_open.args|: the command arguments as a list *nvim-tree.system_open.args*
type: `{string}` The command arguments as a list.
default: `{}` Type: {string}, Default: {}
*nvim-tree.diagnostics* *nvim-tree.diagnostics*
- |diagnostics|: show lsp diagnostics in the signcolumn Show lsp diagnostics in the signcolumn
- |diagnostics.enable|: enable/disable the feature *nvim-tree.diagnostics.enable*
type: `boolean` Enable/disable the feature.
default: `false` Type: `boolean`, Default: `false`
- |diagnostics.show_on_dirs|: if the node with diagnostic is not visible, *nvim-tree.diagnostics.show_on_dirs*
then show diagnostic in the parent directory If the node with diagnostic is not visible, then show diagnostic in the
type: `boolean` parent directory.
default: `false` Type: `boolean`, Default: `false`
- |diagnostics.icons|: icons for diagnostic severity *nvim-tree.diagnostics.icons*
type: `table` Icons for diagnostic severity.
default: `{ hint = "", info = "", warning = "", error = "" }` Type: {}, Default: { hint = "", info = "", warning = "", error = "" }
`NOTE`: it will use the default diagnostic color groups to highlight the signs. `NOTE`: it will use the default diagnostic color groups to highlight the signs.
If you wish to customize, you can override these groups: If you wish to customize, you can override these groups:
@ -346,20 +329,20 @@ Here is a list of the options available in the setup call:
- `NvimTreeLspDiagnosticsHint` - `NvimTreeLspDiagnosticsHint`
*nvim-tree.git* *nvim-tree.git*
- |git|: git integration with icons and colors Git integration with icons and colors.
- |git.enable|: enable / disable the feature *nvim-tree.git.enable*
type: `boolean` Enable / disable the feature.
default: `true` Type: `boolean`, Default: `true`
- |git.ignore|: ignore files based on `.gitignore` *nvim-tree.git.ignore*
Ignore files based on `.gitignore`.
Toggle via the `toggle_git_ignored` action, default mapping `I`. Toggle via the `toggle_git_ignored` action, default mapping `I`.
type: `boolean` Type: `boolean`, Default: `true`
default: `true`
- |git.timeout|: kills the git process after some time if it takes too long *nvim-tree.git.timeout*
type: `number` Kills the git process after some time if it takes too long.
default: `400` (ms) Type: `number`, Default: `400` (ms)
You will still need to configure `g:nvim_tree_show_icons.git` or You will still need to configure `g:nvim_tree_show_icons.git` or
`g:nvim_tree_git_hl` to be able to see things in the tree. This will be `g:nvim_tree_git_hl` to be able to see things in the tree. This will be
@ -372,203 +355,201 @@ Here is a list of the options available in the setup call:
process returned the data. process returned the data.
*nvim-tree.view* *nvim-tree.view*
- |view|: window / buffer setup Window / buffer setup.
- |view.hide_root_folder|: hide the path of the current working *nvim-tree.view.hide_root_folder*
directory on top of the tree Hide the path of the current working directory on top of the tree.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
- |view.width|: width of the window, can be either a `%` string or *nvim-tree.view.width*
a number representing columns. Only works with |view.side| `left` or `right` Width of the window, can be either a `%` string or a number representing columns.
type: `string | number` Only works with `side` is `left` or `right`.
default: `30` Type: `string | number`, Default: `30`
- |view.height|: height of the window, can be either a `%` string or *nvim-tree.view.height*
a number representing rows. Only works with |view.side| `top` or `bottom` Height of the window, can be either a `%` string or a number representing rows.
type: `string | number` Only works with `side` is `top` or `bottom`
default: `30` Type: `string | number`, Default: `30`
- |view.side|: side of the tree, can be one of 'left' | 'right' | 'bottom' | 'top' *nvim-tree.view.side*
Side of the tree, can be one of 'left' | 'right' | 'bottom' | 'top'.
Note that bottom/top are not working correctly yet. Note that bottom/top are not working correctly yet.
type: `string` Type: `string`, Default: 'left'
default: 'left'
- |view.preserve_window_proportions|: preserve window proportions when *nvim-tree.view.preserve_window_proportions*
opening a file. If `false`, the height and width of windows other than Preserves window proportions when opening a file.
nvim-tree will be equalized. If `false`, the height and width of windows other than nvim-tree will be equalized.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
- |view.number|: print the line number in front of each line. *nvim-tree.view.number*
type: `boolean` Print the line number in front of each line.
default: `false` Type: `boolean`, Default: `false`
- |view.relativenumber|: show the line number relative to the line with the *nvim-tree.view.relativenumber*
cursor in front of each line. If the option `view.number` is also `true`, Show the line number relative to the line with the cursor in front of each line.
the number on the cursor line will be the line number instead of `0`. If the option `view.number` is also `true`, the number on the cursor line
type: `boolean` will be the line number instead of `0`.
default: `false` Type: `boolean`, Default: `false`
- |view.signcolumn|: show diagnostic sign column. Value can be `"yes"`, *nvim-tree.view.signcolumn*
`"auto"`, `"no"` Show diagnostic sign column. Value can be `"yes"`, `"auto"`, `"no"`.
type: `string` Type: `string`, Default: `"yes"`
default: `"yes"`
- |view.mappings|: configuration options for keymaps *nvim-tree.view.mappings*
Configuration options for keymaps
- |view.mappings.custom_only|: will use only the provided user mappings and not the default *nvim-tree.view.mappings.custom_only*
otherwise, extends the default mappings with the provided user mappings Will use only the provided user mappings and not the default otherwise,
type: `boolean` extends the default mappings with the provided user mappings.
default: `false` Type: `boolean`, Default: `false`
- |view.mappings.list|: a list of keymaps that will extend or override the default keymaps *nvim-tree.view.mappings.list*
type: list of `{ key: table of strings or string, mode: string (vim-mode), cb: callback function as a string }` A list of keymaps that will extend or override the default keymaps.
default: `{}` Type: list of { key: table of strings or string, mode: string (vim-mode), cb: callback function as a string }
Default: {}
*nvim-tree.renderer* *nvim-tree.renderer*
- |renderer|: UI rendering setup UI rendering setup
- |renderer.indent_markers|: configuration options for tree indent markers *nvim-tree.renderer.indent_markers*
Configuration options for tree indent markers.
- |renderer.indent_markers.enable|: display indent markers when folders are open *nvim-tree.renderer.indent_markers.enable*
type: `boolean` Display indent markers when folders are open
default: `false` Type: `boolean`, Default: `false`
- |renderer.indent_markers.icons|: icons shown before the file/directory *nvim-tree.renderer.indent_markers.icons*
type: `table` Icons shown before the file/directory.
default: `{ corner = "└ ", edge = "│ ", none = " ", }` Type: `table`, Default: `{ corner = "└ ", edge = "│ ", none = " ", }`
- |renderer.icons|: configuration options for icons *nvim-tree.renderer.icons*
Configuration options for icons.
- |renderer.icons.webdev_colors|: use the webdev icon colors, otherwise `NvimTreeFileIcon`. *nvim-tree.renderer.icons.webdev_colors*
type: `boolean` Use the webdev icon colors, otherwise `NvimTreeFileIcon`.
default: `true` Type: `boolean`, Default: `true`
- |renderer.icons.git_placement|: place where the git icons will be rendered. *nvim-tree.renderer.icons.git_placement*
Place where the git icons will be rendered.
After or before the `filename` (after the file/folders icons). After or before the `filename` (after the file/folders icons).
type: `after` or `before` Type: `after` or `before`, Default: `before`
default: `before`
*nvim-tree.filters* *nvim-tree.filters*
|filters|: filtering options Filtering options.
- |filters.dotfiles|: do not show dotfiles: files starting with a `.` *nvim-tree.filters.dotfiles*
Do not show dotfiles: files starting with a `.`
Toggle via the `toggle_dotfiles` action, default mapping `H`. Toggle via the `toggle_dotfiles` action, default mapping `H`.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
- |filters.custom|: custom list of vim regex for file/directory names that will not be shown. *nvim-tree.filters.custom*
Custom list of vim regex for file/directory names that will not be shown.
Backslashes must be escaped e.g. "^\\.git". See |string-match|. Backslashes must be escaped e.g. "^\\.git". See |string-match|.
Toggle via the `toggle_custom` action, default mapping `U`. Toggle via the `toggle_custom` action, default mapping `U`.
type: `{string}` Type: {string}, Default: {}
default: `{}`
- |filters.exclude|: list of directories or files to exclude from filtering: always show them. *nvim-tree.filters.exclude*
List of directories or files to exclude from filtering: always show them.
Overrides `git.ignore`, `filters.dotfiles` and `filters.custom`. Overrides `git.ignore`, `filters.dotfiles` and `filters.custom`.
type: `{string}` Type: {string}, Default: {}
default: `{}`
*nvim-tree.trash* *nvim-tree.trash*
|trash|: configuration options for trashing Configuration options for trashing.
- |trash.cmd|: the command used to trash items (must be installed on your system) *nvim-tree.trash.cmd*
type: `string` The command used to trash items (must be installed on your system).
default: `"trash"` Type: `string`, Default: `"trash"`
- |trash.require_confirm|: show a prompt before trashing takes place. *nvim-tree.trash.require_confirm*
type: `boolean` Show a prompt before trashing takes place.
default: `true` Type: `boolean`, Default: `true`
*nvim-tree.actions* *nvim-tree.actions*
|actions|: configuration for various actions Configuration for various actions.
- |actions.change_dir.enable|: change the working directory when changing *nvim-tree.actions.change_dir.enable*
directories in the tree. Change the working directory when changing directories in the tree.
type: `boolean` Type: `boolean`, Default: `true`
default: `true`
- |actions.change_dir.global|: use `:cd` instead of `:lcd` when changing *nvim-tree.actions.change_dir.global*
directories. Consider that this might cause issues with Use `:cd` instead of `:lcd` when changing directories.
the |update_cwd| options. Consider that this might cause issues with the `update_cwd` options.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
- |actions.change_dir.restrict_above_cwd|: restrict changing to a directory *nvim-tree.actions.change_dir.restrict_above_cwd*
above the global current working directory. Restrict changing to a directory above the global current working directory.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
- |actions.open_file.quit_on_open|: closes the explorer when opening a file. *nvim-tree.actions.open_file.quit_on_open*
Closes the explorer when opening a file.
It will also disable preventing a buffer overriding the tree. It will also disable preventing a buffer overriding the tree.
type: `boolean` Type: `boolean`, Default: `false`
default: `false`
- |actions.open_file.resize_window|: resizes the tree when opening a file *nvim-tree.actions.open_file.resize_window*
type: `boolean` Resizes the tree when opening a file.
default: `false` Type: `boolean`, Default: `false`
- |actions.open_file.window_picker|: window picker configuration *nvim-tree.actions.open_file.window_picker*
Window picker configuration.
- |actions.open_file.window_picker.enable|: Enable the feature. If the *nvim-tree.actions.open_file.window_picker.enable*
feature is not enabled, files will open in window from which you Enable the feature. If the feature is not enabled, files will open in window
last opened the tree. from which you last opened the tree.
type: `boolean` Type: `boolean`, Default: `true`
default: `true`
- |actions.open_file.window_picker.chars|: A string of chars used as *nvim-tree.actions.open_file.window_picker.chars*
identifiers by the window picker. A string of chars used as identifiers by the window picker.
type: `string` Type: `string`, Default: `"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"`
default: `"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"`
- |actions.open_file.window_picker.exclude|: Table of buffer option names *nvim-tree.actions.open_file.window_picker.exclude*
mapped to a list of option values that indicates to the picker that the Table of buffer option names mapped to a list of option values that indicates
buffer's window should not be selectable. to the picker that the buffer's window should not be selectable.
type: `table` Type: `table`
default: `{` Default: {
`filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },` `filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },`
`buftype = { "nofile", "terminal", "help", }` `buftype = { "nofile", "terminal", "help", }`
`}` }
- |actions.use_system_clipboard|: A boolean value that toggle the use of system clipboard *nvim-tree.actions.use_system_clipboard*
when copy/paste function are invoked. A boolean value that toggle the use of system clipboard when copy/paste
When enabled, copied text will be stored in registers '+' (system), otherwise, it will be stored in '1' and '"'. function are invoked. When enabled, copied text will be stored in registers
type: `boolean` '+' (system), otherwise, it will be stored in '1' and '"'.
default: `true` Type: `boolean`, Default: `true`
*nvim-tree.log* *nvim-tree.log*
|log|: configuration for diagnostic logging Configuration for diagnostic logging.
- |log.enable|: enable logging to a file `$XDG_CACHE_HOME/nvim/nvim-tree.log` *nvim-tree.log.enable*
type: `boolean` Enable logging to a file `$XDG_CACHE_HOME/nvim/nvim-tree.log`
default: `false` Type: `boolean`, Default: `false`
- |log.truncate|: remove existing log file at startup *nvim-tree.log.truncate*
type: `boolean` Remove existing log file at startup.
default: `false` Type: `boolean`, Default: `false`
- |log.types|: specify which information to log *nvim-tree.log.types*
Specify which information to log.
- |log.types.all|: everything *nvim-tree.log.types.all*
type: `boolean` Everything.
default: `false` Type: `boolean`, Default: `false`
- |log.types.profile|: timing of some operations *nvim-tree.log.types.profile*
type: `boolean` Timing of some operations.
default: `false` Type: `boolean`, Default: `false`
- |log.types.config|: options and mappings, at startup *nvim-tree.log.types.config*
type: `boolean` Options and mappings, at startup.
default: `false` Type: `boolean`, Default: `false`
- |log.types.copy_paste|: file copy and paste actions *nvim-tree.log.types.copy_paste*
type: `boolean` File copy and paste actions.
default: `false` Type: `boolean`, Default: `false`
- |log.types.git|: git processing *nvim-tree.log.types.git*
type: `boolean` Git processing.
default: `false` Type: `boolean`, Default: `false`
============================================================================== ==============================================================================
OPTIONS *nvim-tree-options* OPTIONS *nvim-tree-options*