nvim/lua/plugs/nvimtree.lua

41 lines
997 B
Lua
Raw Normal View History

2023-10-01 17:18:36 +08:00
return {
2024-01-03 14:50:03 +08:00
"nvim-tree/nvim-tree.lua",
dependencies = {
'kyazdani42/nvim-web-devicons'
},
keys = {
"<c-e>"
},
config = function()
2024-01-16 20:16:19 +08:00
require 'nvim-web-devicons'.setup {}
2023-10-15 22:30:52 +08:00
2024-01-03 14:50:03 +08:00
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)
2023-11-23 13:19:07 +08:00
2024-01-03 14:50:03 +08:00
-- override a default
G.map({
{ 'n', 'v', api.node.open.vertical, { buffer = bufnr } },
{ 'n', 's', api.node.open.horizontal, { buffer = bufnr } },
})
2023-11-15 12:56:11 +08:00
2024-01-03 14:50:03 +08:00
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
2023-10-01 17:18:36 +08:00
}