add nvimtree
This commit is contained in:
parent
c8f785510d
commit
01d4e05983
34
init.lua
34
init.lua
|
@ -49,7 +49,7 @@ Kickstart Guide:
|
||||||
- <escape key>
|
- <escape key>
|
||||||
- :
|
- :
|
||||||
- Tutor
|
- Tutor
|
||||||
- <enter key>
|
- <enter key>disa
|
||||||
|
|
||||||
(If you already know the Neovim basics, you can skip this step.)
|
(If you already know the Neovim basics, you can skip this step.)
|
||||||
|
|
||||||
|
@ -237,7 +237,39 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- Use `opts = {}` to force a plugin to be loaded.
|
-- Use `opts = {}` to force a plugin to be loaded.
|
||||||
--
|
--
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
version = '*',
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('nvim-tree').setup {}
|
||||||
|
local function my_on_attach(bufnr)
|
||||||
|
local api = require 'nvim-tree.api'
|
||||||
|
|
||||||
|
local function opts(desc)
|
||||||
|
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||||
|
end
|
||||||
|
|
||||||
|
-- default mappings
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
|
|
||||||
|
-- custom mappings
|
||||||
|
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts 'Up')
|
||||||
|
vim.keymap.set('n', '?', api.tree.toggle_help, opts 'Help')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- pass to setup along with your other options
|
||||||
|
require('nvim-tree').setup {
|
||||||
|
---
|
||||||
|
on_attach = my_on_attach,
|
||||||
|
---
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
-- Here is a more advanced example where we pass configuration
|
-- Here is a more advanced example where we pass configuration
|
||||||
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
||||||
-- require('gitsigns').setup({ ... })
|
-- require('gitsigns').setup({ ... })
|
||||||
|
|
Loading…
Reference in New Issue