46 lines
1.2 KiB
Lua
46 lines
1.2 KiB
Lua
local vim = vim
|
|
|
|
-- setup with all defaults
|
|
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
|
-- nested options are documented by accessing them with `.` (eg: `:help nvim-tree.view.mappings.list`).
|
|
|
|
require("nvim-tree").setup({
|
|
sort_by = "case_sensitive",
|
|
sync_root_with_cwd = true,
|
|
reload_on_bufenter = true,
|
|
view = {
|
|
cursorline = true,
|
|
width = 42,
|
|
side = "left",
|
|
},
|
|
renderer = {
|
|
group_empty = true,
|
|
},
|
|
filters = {
|
|
dotfiles = false,
|
|
},
|
|
update_focused_file = {
|
|
enable = true,
|
|
update_root = true,
|
|
ignore_list = {},
|
|
},
|
|
tab = {
|
|
sync = {
|
|
open = true,
|
|
close = true,
|
|
ignore = {},
|
|
},
|
|
},
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("BufEnter", {
|
|
group = vim.api.nvim_create_augroup("NvimTreeClose", {clear = true}),
|
|
pattern = "NvimTree_*",
|
|
callback = function()
|
|
local layout = vim.api.nvim_call_function("winlayout", {})
|
|
if layout[1] == "leaf" and vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), "filetype") == "NvimTree" and layout[3] == nil then
|
|
vim.cmd("confirm quit")
|
|
end
|
|
end
|
|
})
|