nvimtree: update config
This commit is contained in:
+26
-21
@@ -1,43 +1,48 @@
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" -- optional, for file icon
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons", -- optional, for file icon
|
||||
},
|
||||
lazy = false,
|
||||
opts = {
|
||||
-- open_on_tab = true,
|
||||
sync_root_with_cwd = true,
|
||||
tab = {
|
||||
sync = {
|
||||
open = true
|
||||
}
|
||||
open = true,
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
show_on_dirs = false
|
||||
show_on_dirs = false,
|
||||
},
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true
|
||||
enable = true,
|
||||
},
|
||||
group_empty = true
|
||||
}
|
||||
group_empty = true,
|
||||
},
|
||||
},
|
||||
keys = { {
|
||||
'<C-n>',
|
||||
'<Cmd>NvimTreeFindFileToggle <CR>',
|
||||
desc = "Nvimtree Toggle"
|
||||
}, {
|
||||
'<Leader>a',
|
||||
'<Cmd>NvimTreeFocus <CR>',
|
||||
desc = "Nvimtree Focus"
|
||||
} },
|
||||
config = function()
|
||||
keys = {
|
||||
{
|
||||
"<C-n>",
|
||||
"<Cmd>NvimTreeFindFileToggle <CR>",
|
||||
desc = "Nvimtree Toggle",
|
||||
},
|
||||
{
|
||||
"<Leader>a",
|
||||
"<Cmd>NvimTreeFocus <CR>",
|
||||
desc = "Nvimtree Focus",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("nvim-tree").setup(opts)
|
||||
local function open_nvim_tree()
|
||||
-- open the tree
|
||||
require("nvim-tree.api").tree.toggle({focus = false, find_file = true})
|
||||
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
|
||||
end
|
||||
vim.api.nvim_create_autocmd({"VimEnter"}, {
|
||||
callback = open_nvim_tree
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = open_nvim_tree,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user