update nvim-tree config

This commit is contained in:
asep komarudin 2023-02-27 14:52:49 +07:00
parent 5a53ad9060
commit 028e3d9895
9 changed files with 29 additions and 30 deletions

View file

@ -1,23 +1,16 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- set termguicolors to enable highlight groups
vim.opt.termguicolors = true
local status_ok, nvim_tree = pcall(require, "nvim-tree")
if not status_ok then
return
end
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
if not config_status_ok then
return
end
local tree_cb = nvim_tree_config.nvim_tree_callback
local icons = require("user.icons")
nvim_tree.setup({
update_focused_file = {
enable = true,
update_cwd = true,
},
select_prompts = true,
renderer = {
renderer = {
root_folder_modifier = ":t",
indent_markers = {
enable = true,
@ -63,7 +56,7 @@ nvim_tree.setup({
},
},
},
diagnostics = {
diagnostics = {
enable = true,
show_on_dirs = true,
icons = {
@ -73,16 +66,9 @@ nvim_tree.setup({
error = icons.diagnostics.BoldError,
},
},
view = {
view = {
width = 30,
hide_root_folder = false,
side = "left",
mappings = {
list = {
{ key = { "l", "<CR>", "o" }, cb = tree_cb("edit") },
{ key = "h", cb = tree_cb("close_node") },
{ key = "v", cb = tree_cb("vsplit") },
},
},
},
})
})