nvim/lua/plugs/nvimtree.lua
2024-01-16 20:16:19 +08:00

41 lines
997 B
Lua

return {
"nvim-tree/nvim-tree.lua",
dependencies = {
'kyazdani42/nvim-web-devicons'
},
keys = {
"<c-e>"
},
config = function()
require 'nvim-web-devicons'.setup {}
require 'nvim-tree'.setup {
sort_by = "case_sensitive",
view = {
width = 30,
},
filters = { dotfiles = true, },
git = { enable = true },
on_attach = function(bufnr)
local api = require 'nvim-tree.api'
api.config.mappings.default_on_attach(bufnr)
-- override a default
G.map({
{ 'n', 'v', api.node.open.vertical, { buffer = bufnr } },
{ 'n', 's', api.node.open.horizontal, { buffer = bufnr } },
})
G.delmap({
{ 'n', '<C-e>', { buffer = bufnr } },
{ 'n', '<C-v>', { buffer = bufnr } },
{ 'n', '<C-x>', { buffer = bufnr } },
})
end
}
G.map({
{ "n", "<C-e>", ":NvimTreeToggle<CR>", { noremap = true } },
})
end
}