You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-35Lines changed: 10 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,31 +36,20 @@ Note that options under the `g:` command should be set **BEFORE** running the se
36
36
37
37
```lua
38
38
-- following options are the default
39
+
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
39
40
require'nvim-tree'.setup {
40
-
-- disables netrw completely
41
41
disable_netrw=true,
42
-
-- hijack netrw window on startup
43
42
hijack_netrw=true,
44
-
-- open the tree when running this setup function
45
43
open_on_setup=false,
46
-
-- will not open on setup if the filetype is in this list
47
44
ignore_ft_on_setup= {},
48
-
-- closes neovim automatically when the tree is the last **WINDOW** in the view
49
45
auto_close=false,
50
-
-- opens the tree when changing/opening a new tab if the tree wasn't previously opened
51
46
open_on_tab=false,
52
-
-- hijacks new directory buffers when they are opened.
47
+
hijack_cursor=false,
48
+
update_cwd=false,
53
49
update_to_buf_dir= {
54
-
-- enable the feature
55
50
enable=true,
56
-
-- allow to open the tree if it was previously closed
57
51
auto_open=true,
58
52
},
59
-
-- hijack the cursor in the tree to put it at the start of the filename
60
-
hijack_cursor=false,
61
-
-- updates the root directory of the tree on `DirChanged` (when you run `:cd` usually)
62
-
update_cwd=false,
63
-
-- show lsp diagnostics in the signcolumn
64
53
diagnostics= {
65
54
enable=false,
66
55
icons= {
@@ -70,53 +59,39 @@ require'nvim-tree'.setup {
70
59
error="",
71
60
}
72
61
},
73
-
-- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file
74
62
update_focused_file= {
75
-
-- enables the feature
76
63
enable=false,
77
-
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
78
-
-- only relevant when `update_focused_file.enable` is true
79
64
update_cwd=false,
80
-
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
81
-
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
82
65
ignore_list= {}
83
66
},
84
-
-- configuration options for the system open command (`s` in the tree by default)
85
67
system_open= {
86
-
-- the command to run this, leaving nil should work in most cases
87
68
cmd=nil,
88
-
-- the command arguments as a list
89
69
args= {}
90
70
},
91
-
71
+
filters= {
72
+
dotfiles=false,
73
+
custom= {}
74
+
},
92
75
view= {
93
-
-- width of the window, can be either a number (columns) or a string in `%`, for left or right side placement
94
76
width=30,
95
-
-- height of the window, can be either a number (columns) or a string in `%`, for top or bottom side placement
96
77
height=30,
97
-
-- Hide the root path of the current folder on top of the tree
98
78
hide_root_folder=false,
99
-
-- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom'
100
79
side='left',
101
-
-- if true the tree will resize itself after opening a file
102
80
auto_resize=false,
103
81
mappings= {
104
-
-- custom only false will merge the list with the default mappings
105
-
-- if true, it will only use your list to set the mappings
106
82
custom_only=false,
107
-
-- list of mappings to set on the tree manually
108
83
list= {}
109
84
}
110
85
}
111
86
}
112
87
```
113
88
89
+
These additional options must be set **BEFORE** calling `require'nvim-tree'` or calling setup.
90
+
They are being migrated to the setup function bit by bit, check [this issue](https://github.com/kyazdani42/nvim-tree.lua/issues/674) if you encounter any problems related to configs not working after update.
114
91
```vim
115
-
let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
116
92
let g:nvim_tree_gitignore = 1 "0 by default
117
93
let g:nvim_tree_quit_on_open = 1 "0 by default, closes the tree when you open a file
118
94
let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open
119
-
let g:nvim_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot `.`
120
95
let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons).
121
96
let g:nvim_tree_highlight_opened_files = 1 "0 by default, will enable folder and file icon highlight for opened files/directories.
122
97
let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options
0 commit comments