-
Notifications
You must be signed in to change notification settings - Fork 0
/
nvimtree.lua
105 lines (97 loc) · 3.64 KB
/
nvimtree.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
local M = {
"nvim-tree/nvim-tree.lua",
event = "VeryLazy",
}
function M.config()
local function my_on_attach(bufnr)
local api = require("nvim-tree.api")
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set("n", "l", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "h", api.node.navigate.parent_close, opts("Close Directory"))
vim.keymap.set("n", "v", api.node.open.vertical, opts("Open: Vertical Split"))
vim.keymap.del("n", "<C-k>", { buffer = bufnr })
vim.keymap.set("n", "<S-k>", api.node.open.preview, opts("Open Preview"))
end
local icons = require("user.lspicons")
require("nvim-tree").setup({
on_attach = my_on_attach,
hijack_netrw = false,
sync_root_with_cwd = true,
renderer = {
add_trailing = false,
group_empty = false,
highlight_git = false,
full_name = false,
highlight_opened_files = "none",
root_folder_label = ":t",
indent_width = 2,
indent_markers = {
enable = false,
inline_arrows = true,
icons = {
corner = "└",
edge = "│",
item = "│",
none = " ",
},
},
icons = {
git_placement = "before",
padding = " ",
symlink_arrow = " ➛ ",
glyphs = {
default = icons.ui.Text,
symlink = icons.ui.FileSymlink,
bookmark = icons.ui.BookMark,
folder = {
arrow_closed = icons.ui.ChevronRight,
arrow_open = icons.ui.ChevronShortDown,
default = icons.ui.Folder,
open = icons.ui.FolderOpen,
empty = icons.ui.EmptyFolder,
empty_open = icons.ui.EmptyFolderOpen,
symlink = icons.ui.FolderSymlink,
symlink_open = icons.ui.FolderOpen,
},
git = {
unstaged = icons.git.FileUnstaged,
staged = icons.git.FileStaged,
unmerged = icons.git.FileUnmerged,
renamed = icons.git.FileRenamed,
untracked = icons.git.FileUntracked,
deleted = icons.git.FileDeleted,
ignored = icons.git.FileIgnored,
},
},
},
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true,
},
update_focused_file = {
enable = true,
debounce_delay = 15,
update_root = true,
ignore_list = {},
},
diagnostics = {
enable = true,
show_on_dirs = false,
show_on_open_dirs = true,
debounce_delay = 50,
severity = {
min = vim.diagnostic.severity.HINT,
max = vim.diagnostic.severity.ERROR,
},
icons = {
hint = icons.diagnostics.BoldHint,
info = icons.diagnostics.BoldInformation,
warning = icons.diagnostics.BoldWarning,
error = icons.diagnostics.BoldError,
},
},
})
end
return M