Skip to content

Commit b65ecd6

Browse files
committed
Outlined new options
1 parent 87409bb commit b65ecd6

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

doc/nvim-tree-lua.txt

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ Subsequent calls to setup will replace the previous configuration.
222222
highlight_git = false,
223223
full_name = false,
224224
highlight_opened_files = "none",
225+
highlight_modified = false,
225226
root_folder_label = ":~:s?$?/..?",
226227
indent_width = 2,
227228
indent_markers = {
@@ -240,6 +241,8 @@ Subsequent calls to setup will replace the previous configuration.
240241
git_placement = "before",
241242
padding = " ",
242243
symlink_arrow = " ➛ ",
244+
modified = "[+]",
245+
modified_placement = "after",
243246
show = {
244247
file = true,
245248
folder = true,
@@ -324,6 +327,12 @@ Subsequent calls to setup will replace the previous configuration.
324327
show_on_open_dirs = true,
325328
timeout = 400,
326329
},
330+
modified = {
331+
enable = false,
332+
show_on_dirs = true,
333+
show_on_open_dirs = false,
334+
debounce_delay = 50,
335+
},
327336
actions = {
328337
use_system_clipboard = true,
329338
change_dir = {
@@ -542,6 +551,7 @@ Configuration options for the system open command.
542551

543552
*nvim-tree.diagnostics*
544553
Show LSP and COC diagnostics in the signcolumn
554+
Note that the modified sign will take precedence over the diagnostics signs.
545555

546556
`NOTE`: it will use the default diagnostic color groups to highlight the signs.
547557
If you wish to customize, you can override these groups:
@@ -617,6 +627,28 @@ Git integration with icons and colors.
617627
milliseconds but a few seconds), it will not render anything until the git
618628
process returned the data.
619629

630+
*nvim-tree.modified*
631+
Indicate which file have unsaved modification.
632+
633+
*nvim-tree.modified.enable*
634+
Enable / disable the feature.
635+
Type: `boolean`, Default: `false`
636+
637+
*nvim-tree.modified.show_on_dirs*
638+
Show modified indication on directory whose children are modified.
639+
Type: `boolean`, Default: `true`
640+
641+
*nvim-tree.modified.show_on_open_dirs*
642+
Show modified indication on open directories.
643+
Only relevant when |modified.show_on_dirs| is `true`.
644+
Type: `boolean`, Default: `false`
645+
646+
*nvim-tree.modified.debounce_delay*
647+
Idle milliseconds between the file is modified and action.
648+
This helps performance when large number of files are modified in quick
649+
succession (e.g. lsp rename).
650+
Type: `number`, Default: `50` (ms)
651+
620652
*nvim-tree.filesystem_watchers*
621653
Will use file system watcher (libuv fs_event) to watch the filesystem for
622654
changes.
@@ -773,6 +805,12 @@ UI rendering setup
773805
Value can be `"none"`, `"icon"`, `"name"` or `"all"`.
774806
Type: `string`, Default: `"none"`
775807

808+
*nvim-tree.renderer.highlight_modified*
809+
Enable file highlight for modified files using NvimTreeModified highlight
810+
groups.
811+
This can be used with or without the icons.
812+
Type: `boolean`, Default `false`
813+
776814
*nvim-tree.renderer.root_folder_label* (previously `renderer.root_folder_modifier`)
777815
In what format to show root folder. See `:help filename-modifiers` for
778816
available `string` options.
@@ -815,7 +853,7 @@ UI rendering setup
815853
Place where the git icons will be rendered.
816854
Can be `"after"` or `"before"` filename (after the file/folders icons)
817855
or `"signcolumn"` (requires |nvim-tree.view.signcolumn| enabled).
818-
Note that the diagnostic signs will take precedence over the git signs.
856+
Note that the diagnostic signs and the modified sign will take precedence over the git signs.
819857
Type: `string`, Default: `before`
820858

821859
*nvim-tree.renderer.icons.padding*
@@ -827,6 +865,17 @@ UI rendering setup
827865
Used as a separator between symlinks' source and target.
828866
Type: `string`, Default: `" ➛ "`
829867

868+
*nvim-tree.renderer.icons.modified*
869+
Icon to display for modified files. Can be multiple characters if
870+
|renderer.icons.modified_placement| isn't `"signcolumn"`.
871+
Type: `string`, Default: `"[+]"`
872+
873+
*nvim-tree.renderer.icons.modified_placement*
874+
Place where the modified icon will be rendered.
875+
Can be `"after"` or `"before"` filename (after the file/folders icons)
876+
or `"signcolumn"` (requires |nvim-tree.view.signcolumn| enabled).
877+
Type: `string`, Default: `after`
878+
830879
*nvim-tree.renderer.icons.show*
831880
Configuration options for showing icon types.
832881

lua/nvim-tree.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
523523
highlight_git = false,
524524
full_name = false,
525525
highlight_opened_files = "none",
526+
highlight_modified = false,
526527
root_folder_label = ":~:s?$?/..?",
527528
indent_width = 2,
528529
indent_markers = {
@@ -541,6 +542,8 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
541542
git_placement = "before",
542543
padding = " ",
543544
symlink_arrow = "",
545+
modified = "[+]",
546+
modified_placement = "after",
544547
show = {
545548
file = true,
546549
folder = true,
@@ -625,6 +628,12 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
625628
show_on_open_dirs = true,
626629
timeout = 400,
627630
},
631+
modified = {
632+
enable = false,
633+
show_on_dirs = true,
634+
show_on_open_dirs = false,
635+
debounce_delay = 50,
636+
},
628637
actions = {
629638
use_system_clipboard = true,
630639
change_dir = {

0 commit comments

Comments
 (0)