@@ -43,103 +43,31 @@ use {
43
43
requires = {
44
44
" nvim-lua/plenary.nvim" ,
45
45
" kyazdani42/nvim-web-devicons" , -- not strictly required, but recommended
46
- " MunifTanjim/nui.nvim"
46
+ " MunifTanjim/nui.nvim"
47
47
},
48
48
config = function ()
49
- require (" neo-tree" ).setup ({
50
- popup_border_style = " rounded" ,
51
- enable_git_status = true ,
52
- enable_diagnostics = true ,
53
- filesystem = {
54
- filters = { -- These filters are applied to both browsing and searching
55
- show_hidden = false ,
56
- respect_gitignore = true ,
57
- },
58
- follow_current_file = false , -- This will find and focus the file in the
59
- -- active buffer every time the current file is changed while the tree is open.
60
- use_libuv_file_watcher = false , -- This will use the OS level file watchers
61
- -- to detect changes instead of relying on nvim autocmd events.
62
- window = {
63
- position = " left" ,
64
- width = 40 ,
65
- mappings = {
66
- [" <2-LeftMouse>" ] = " open" ,
67
- [" <cr>" ] = " open" ,
68
- [" S" ] = " open_split" ,
69
- [" s" ] = " open_vsplit" ,
70
- [" C" ] = " close_node" ,
71
- [" <bs>" ] = " navigate_up" ,
72
- [" ." ] = " set_root" ,
73
- [" H" ] = " toggle_hidden" ,
74
- [" I" ] = " toggle_gitignore" ,
75
- [" R" ] = " refresh" ,
76
- [" /" ] = " filter_as_you_type" ,
77
- -- ["/"] = "none" -- Assigning a key to "none" will remove the default mapping
78
- [" f" ] = " filter_on_submit" ,
79
- [" <c-x>" ] = " clear_filter" ,
80
- [" a" ] = " add" ,
81
- [" d" ] = " delete" ,
82
- [" r" ] = " rename" ,
83
- [" c" ] = " copy_to_clipboard" ,
84
- [" x" ] = " cut_to_clipboard" ,
85
- [" p" ] = " paste_from_clipboard" ,
86
- [" bd" ] = " buffer_delete" ,
87
- }
88
- }
89
- },
90
- buffers = {
91
- show_unloaded = true ,
92
- window = {
93
- position = " left" ,
94
- mappings = {
95
- [" <2-LeftMouse>" ] = " open" ,
96
- [" <cr>" ] = " open" ,
97
- [" S" ] = " open_split" ,
98
- [" s" ] = " open_vsplit" ,
99
- [" <bs>" ] = " navigate_up" ,
100
- [" ." ] = " set_root" ,
101
- [" R" ] = " refresh" ,
102
- [" a" ] = " add" ,
103
- [" d" ] = " delete" ,
104
- [" r" ] = " rename" ,
105
- [" c" ] = " copy_to_clipboard" ,
106
- [" x" ] = " cut_to_clipboard" ,
107
- [" p" ] = " paste_from_clipboard" ,
108
- }
109
- },
110
- },
111
- git_status = {
112
- window = {
113
- position = " float" ,
114
- mappings = {
115
- [" <2-LeftMouse>" ] = " open" ,
116
- [" <cr>" ] = " open" ,
117
- [" S" ] = " open_split" ,
118
- [" s" ] = " open_vsplit" ,
119
- [" C" ] = " close_node" ,
120
- [" R" ] = " refresh" ,
121
- [" d" ] = " delete" ,
122
- [" r" ] = " rename" ,
123
- [" c" ] = " copy_to_clipboard" ,
124
- [" x" ] = " cut_to_clipboard" ,
125
- [" p" ] = " paste_from_clipboard" ,
126
- [" A" ] = " git_add_all" ,
127
- [" gu" ] = " git_unstage_file" ,
128
- [" ga" ] = " git_add_file" ,
129
- [" gr" ] = " git_revert_file" ,
130
- [" gc" ] = " git_commit" ,
131
- [" gp" ] = " git_push" ,
132
- [" gg" ] = " git_commit_and_push" ,
133
- }
134
- }
135
- }
136
- })
49
+ require (" neo-tree" ).setup () -- This is optional if you are not going to
50
+ -- change any of the defaults.
137
51
vim .cmd ([[ nnoremap \ :NeoTreeReveal<cr>]] )
138
52
end
139
53
}
140
54
```
141
- _ The above configuration is not everything that can be changed, it's just the
142
- parts you might want to change first._
55
+
56
+ See ` :h neo-tree ` for full documentation. You can also preview that online at
57
+ [ doc/neo-tree.txt] ( doc/neo-tree.txt ) , although it's best viewed within vim.
58
+
59
+
60
+ ### Config Options
61
+
62
+ To see all of the default config options with commentary, you can view it online
63
+ at [ lua/neo-tree/defaults.lua] ( lua/neo-tree/defaults.lua ) . You can also paste it
64
+ into your config after installing Neo-tree by running ` :NeoTreePasteConfig ` ,
65
+ which will paste the default config as a ` config ` table into the current buffer.
66
+ You can then change what you want in the pasted ` config ` table and pass it to
67
+ ` require("neo-tree").setup(config) `
68
+
69
+
70
+ ### Commands
143
71
144
72
Here are the various ways to open the tree:
145
73
@@ -181,6 +109,7 @@ at [neo-tree.txt](/doc/neo-tree.txt)
181
109
An example configuration for the filesystem source with proper syntax
182
110
highlighting can also be viewed at the [ filesystem README] ( /lua/neo-tree/sources/filesystem/README.md )
183
111
112
+
184
113
## Sources
185
114
186
115
Neo-tree is built on the idea of supporting various sources. Sources are
@@ -192,6 +121,13 @@ those items.
192
121
The default source is ` filesystem ` , which displays your files and folders. This
193
122
is the default source in commands when none is specified.
194
123
124
+ This source can be used to:
125
+ - Browse the filesystem
126
+ - Control the current working directory of nvim
127
+ - Add/Copy/Delete/Move/Rename files and directories
128
+ - Search the filesystem
129
+ - Monitor git status and lsp diagnostics for the current working directory
130
+
195
131
### buffers
196
132
![ Neo-tree buffers] ( https://github.com/nvim-neo-tree/resources/raw/main/images/Neo-tree-buffers.png )
197
133
@@ -220,18 +156,24 @@ built-in functions can be replaced with your own implementation, or you can
220
156
add new ones.
221
157
222
158
Each node in the tree is created from the renderer specified for the given node
223
- type, and each renderer is a list of component configs to be rendered in order
224
- for each node in the tree. Each component is a function, either built-in or
225
- specified in your config. Those functions are called with the config, node, and
226
- state of the plugin, and return the text and highlight group for the component.
159
+ type, and each renderer is a list of component configs to be rendered in order.
160
+ Each component is a function, either built-in or specified in your config. Those
161
+ functions simply return the text and highlight group for the component.
227
162
228
163
Additionally, there is an events system that you can hook into. If you want to
229
164
show some new data point related to your files, gather it in the
230
165
` before_render ` event, create a component to display it, and reference that
231
166
component in the renderer for the ` file ` and/or ` directory ` type.
232
167
233
- Details on how to configure everything is in the help file at ` :h neo-tree ` or
234
- online at [ neo-tree.txt] ( https://github.com/nvim-neo-tree/neo-tree.nvim/blob/main/doc/neo-tree.txt )
168
+ Details on how to configure everything is in the help file at `: h
169
+ neo-tree-configuration` or online at
170
+ [ neo-tree.txt] ( https://github.com/nvim-neo-tree/neo-tree.nvim/blob/main/doc/neo-tree.txt )
171
+
172
+ Recipes for customizations can be found on the [ wiki] ( wiki ) . Recipes include
173
+ things like adding a component to show the
174
+ [ Harpoon] ( https://github.com/ThePrimeagen/harpoon ) index for files, or
175
+ responding to the ` "file_opened" ` event to auto clear the search when you open a
176
+ file.
235
177
236
178
237
179
## Why?
@@ -276,7 +218,7 @@ major version, and the breaking change will happen in the next major version.
276
218
277
219
### Easy to Customize
278
220
279
- This will follow in the spirit of plugins like
221
+ Neo-tree follows in the spirit of plugins like
280
222
[ lualine.nvim] ( https://github.com/nvim-lualine/lualine.nvim ) and
281
223
[ nvim-cokeline] ( https://github.com/noib3/nvim-cokeline ) . Everything will be
282
224
configurable and take either strings, tables, or functions. You can take sane
0 commit comments