Skip to content

Commit 94e1ee1

Browse files
committed
docs: closes #60, consolidate and complete documentation in the help file
1 parent f7a20fa commit 94e1ee1

File tree

10 files changed

+826
-530
lines changed

10 files changed

+826
-530
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ optional scope for this project would usually be the source, i.e.
3232

3333
## Branching
3434

35-
The default branch is et to the current major version to make it simple for end
35+
The default branch is set to the current major version to make it simple for end
3636
users visiting the repo. Pull Requests, however, should go to the `main`
3737
branch. After a short testing period, it will be merged to the current release
3838
branch.
@@ -41,3 +41,18 @@ This project requires a **linear history**. I don't trust merge commits.
4141
This means you will have to rebase your branch on main before the pull request
4242
can be merged. This can get a bit annoying in a busy repository, but I think it
4343
is worth the effort.
44+
45+
## Documentation
46+
47+
All new features should be documented in the commit they were added in. The
48+
current strategy is to maintain:
49+
50+
- Config Options: added to [defaults](lua/neo-tree/defaults.lua) and described
51+
in comments
52+
- The README contains "back of the box" high level overview of features. It is
53+
meant for people trying to decide if they want to install this plugin or not.
54+
It should include refrences to the help file for more information:
55+
`:h neo-tree-setup`
56+
- The vim help file [doc/neo-tree.txt](doc/neo-tree.txt) is the definitive
57+
reference and should contain all information needed to configure and use the
58+
plugin.

README.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ should you!
2727
- Neo-tree can intelligently follow the current file (set `follow_current_file=true`)
2828
- Neo-tree is thoughtful about maintaining or setting focus on the right node
2929
- Neo-tree windows in different tabs are completely separate
30+
- `respect_gitignore` actually works!
3031

3132
Neo-tree is smooth, efficient, stable, and pays attention to the little details.
3233
If you find anything janky, wanky, broken, or unintuitive, please open an issue
@@ -43,7 +44,7 @@ use {
4344
requires = {
4445
"nvim-lua/plenary.nvim",
4546
"kyazdani42/nvim-web-devicons", -- not strictly required, but recommended
46-
"MunifTanjim/nui.nvim"
47+
"MunifTanjim/nui.nvim"
4748
},
4849
config = function ()
4950
require("neo-tree").setup({
@@ -138,9 +139,27 @@ use {
138139
end
139140
}
140141
```
142+
141143
_The above configuration is not everything that can be changed, it's just the
142144
parts you might want to change first._
143145

146+
147+
See `:h neo-tree` for full documentation. You can also preview that online at
148+
[doc/neo-tree.txt](doc/neo-tree.txt), although it's best viewed within vim.
149+
150+
151+
### Config Options
152+
153+
To see all of the default config options with commentary, you can view it online
154+
at [lua/neo-tree/defaults.lua](lua/neo-tree/defaults.lua). You can also paste it
155+
into your config after installing Neo-tree by running `:NeoTreePasteConfig`,
156+
which will paste the default config as a `config` table into the current buffer.
157+
You can then change what you want in the pasted `config` table and pass it to
158+
`require("neo-tree").setup(config)`
159+
160+
161+
### Commands
162+
144163
Here are the various ways to open the tree:
145164

146165
```
@@ -181,6 +200,7 @@ at [neo-tree.txt](/doc/neo-tree.txt)
181200
An example configuration for the filesystem source with proper syntax
182201
highlighting can also be viewed at the [filesystem README](/lua/neo-tree/sources/filesystem/README.md)
183202

203+
184204
## Sources
185205

186206
Neo-tree is built on the idea of supporting various sources. Sources are
@@ -192,6 +212,13 @@ those items.
192212
The default source is `filesystem`, which displays your files and folders. This
193213
is the default source in commands when none is specified.
194214

215+
This source can be used to:
216+
- Browse the filesystem
217+
- Control the current working directory of nvim
218+
- Add/Copy/Delete/Move/Rename files and directories
219+
- Search the filesystem
220+
- Monitor git status and lsp diagnostics for the current working directory
221+
195222
### buffers
196223
![Neo-tree buffers](https://github.com/nvim-neo-tree/resources/raw/main/images/Neo-tree-buffers.png)
197224

@@ -220,18 +247,24 @@ built-in functions can be replaced with your own implementation, or you can
220247
add new ones.
221248

222249
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.
250+
type, and each renderer is a list of component configs to be rendered in order.
251+
Each component is a function, either built-in or specified in your config. Those
252+
functions simply return the text and highlight group for the component.
227253

228254
Additionally, there is an events system that you can hook into. If you want to
229255
show some new data point related to your files, gather it in the
230256
`before_render` event, create a component to display it, and reference that
231257
component in the renderer for the `file` and/or `directory` type.
232258

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)
259+
Details on how to configure everything is in the help file at `:h
260+
neo-tree-configuration` or online at
261+
[neo-tree.txt](https://github.com/nvim-neo-tree/neo-tree.nvim/blob/main/doc/neo-tree.txt)
262+
263+
Recipes for customizations can be found on the [wiki](wiki). Recipes include
264+
things like adding a component to show the
265+
[Harpoon](https://github.com/ThePrimeagen/harpoon) index for files, or
266+
responding to the `"file_opened"` event to auto clear the search when you open a
267+
file.
235268

236269

237270
## Why?
@@ -276,7 +309,7 @@ major version, and the breaking change will happen in the next major version.
276309

277310
### Easy to Customize
278311

279-
This will follow in the spirit of plugins like
312+
Neo-tree follows in the spirit of plugins like
280313
[lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) and
281314
[nvim-cokeline](https://github.com/noib3/nvim-cokeline). Everything will be
282315
configurable and take either strings, tables, or functions. You can take sane

0 commit comments

Comments
 (0)