Skip to content

Commit f5d970d

Browse files
authored
docs: reformat quickstart readme example (#2258)
1 parent 6306140 commit f5d970d

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,27 @@ require("nvim-tree").setup({
7979
Optionally customise your mappings, see [:help nvim-tree-mappings](doc/nvim-tree-lua.txt)
8080

8181
```lua
82-
local function my_on_attach(bufnr)
83-
local api = require "nvim-tree.api"
82+
local function my_on_attach(bufnr)
83+
local api = require "nvim-tree.api"
8484

85-
local function opts(desc)
86-
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
87-
end
85+
local function opts(desc)
86+
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
87+
end
8888

89-
-- default mappings
90-
api.config.mappings.default_on_attach(bufnr)
89+
-- default mappings
90+
api.config.mappings.default_on_attach(bufnr)
9191

92-
-- custom mappings
93-
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
94-
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
95-
end
92+
-- custom mappings
93+
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
94+
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
95+
end
9696

97-
-- pass to setup along with your other options
98-
require("nvim-tree").setup {
99-
---
100-
on_attach = my_on_attach,
101-
---
102-
}
97+
-- pass to setup along with your other options
98+
require("nvim-tree").setup {
99+
---
100+
on_attach = my_on_attach,
101+
---
102+
}
103103
```
104104

105105
Open the tree: `:NvimTreeOpen`

0 commit comments

Comments
 (0)