Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
neovim-config/lua/user/nvimtree.lua

102 lines
1.8 KiB
Lua

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
vim.api.nvim_create_autocmd("BufEnter", {
nested = true,
callback = function()
if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
vim.cmd("quit")
end
end,
})
nvim_tree.setup({
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = {
"alpha",
},
open_on_tab = true,
hijack_cursor = true,
update_cwd = true,
diagnostics = {
enable = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
update_focused_file = {
enable = true,
update_cwd = true,
ignore_list = {},
},
git = {
enable = true,
ignore = true,
timeout = 500,
},
view = {
width = 30,
height = 30,
hide_root_folder = false,
side = "left",
mappings = {
custom_only = false,
list = {
{ key = { "l", "<CR>", "o" }, cb = tree_cb("edit") },
{ key = "h", cb = tree_cb("close_node") },
{ key = "v", cb = tree_cb("vsplit") },
},
},
number = false,
relativenumber = false,
},
actions = {
open_file = {
quit_on_open = false,
window_picker = {
enable = false,
},
},
},
renderer = {
icons = {
glyphs = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
deleted = "",
untracked = "U",
ignored = "",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
},
},
},
},
filesystem_watchers = {
enable = true,
interval = 100,
},
})