nvim/lua/plugs/nvimtree.lua

32 lines
680 B
Lua
Raw Normal View History

2023-10-01 17:18:36 +08:00
return {
2023-11-15 12:56:11 +08:00
'kyazdani42/nvim-web-devicons',
{
2023-11-22 23:19:24 +08:00
"nvim-tree/nvim-tree.lua",
2023-11-15 12:56:11 +08:00
config = function ()
2023-11-22 23:19:24 +08:00
2023-11-15 12:56:11 +08:00
require'nvim-tree'.setup {
sort_by = "case_sensitive",
2023-11-22 23:19:24 +08:00
view = {
width = 30,
},
2023-11-15 12:56:11 +08:00
filters = { dotfiles = true, },
2023-11-15 13:16:34 +08:00
git = { enable = true },
2023-11-22 23:19:24 +08:00
on_attach = function (bufnr)
local api = require'nvim-tree.api'
api.config.mappings.default_on_attach(bufnr)
2023-10-15 22:30:52 +08:00
2023-11-22 23:19:24 +08:00
-- override a default
G.delmap({
{'n', '<C-e>', { buffer = bufnr }},
})
2023-11-15 12:56:11 +08:00
2023-11-22 23:19:24 +08:00
end
}
G.map({
{"n", "<C-e>", ":NvimTreeToggle<CR>", { noremap = true }},
})
end
2023-11-15 12:56:11 +08:00
}
2023-10-01 17:18:36 +08:00
}
2023-10-15 22:30:52 +08:00