docs: clarify on_attach example, quick start (#2165)

* doc: more on_attach examples

* doc: human readable mappings help

* doc: human readable mappings help

* doc: more on_attach examples

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start

* doc: enhance quick start
This commit is contained in:
Alexander Courtis
2023-04-29 17:00:40 +10:00
committed by GitHub
parent 1f5bbc1efd
commit 74996b8626
3 changed files with 104 additions and 12 deletions

View File

@@ -44,13 +44,11 @@ Please install via your preferred package manager. See [Installation](https://gi
`nvim-tree/nvim-web-devicons` optional, for file icons
## Setup
## Quick Start
Setup should be run in a lua file or in a lua heredoc [:help lua-heredoc](https://neovim.io/doc/user/lua.html) if using in a vim file.
Setup the plugin in your `init.lua`
```lua
-- examples for your init.lua
-- disable netrw at the very start of your init.lua (strongly advised)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
@@ -64,6 +62,9 @@ require("nvim-tree").setup()
-- OR setup with some options
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
width = 30,
},
renderer = {
group_empty = true,
},
@@ -73,6 +74,10 @@ require("nvim-tree").setup({
})
```
Open the tree: `:NvimTreeOpen`
Show the mappings: `g?`
For complete list of available configuration options see [:help nvim-tree-setup](doc/nvim-tree-lua.txt)
Each option is documented in `:help nvim-tree.OPTION_NAME`. Nested options can be accessed by appending `.`, for example [:help nvim-tree.filters.dotfiles](doc/nvim-tree-lua.txt)