aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/nvim-tree.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/plugins/nvim-tree.lua')
-rw-r--r--.config/nvim/lua/plugins/nvim-tree.lua77
1 files changed, 77 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua
new file mode 100644
index 0000000..e6cf73c
--- /dev/null
+++ b/.config/nvim/lua/plugins/nvim-tree.lua
@@ -0,0 +1,77 @@
+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
+
+-- To see mappings `g?` on nvim-tree
+-- To see default mappings `:nvim-tree-default-mappings`
+
+nvim_tree.setup({
+ update_focused_file = {
+ enable = true,
+ update_cwd = true,
+ },
+ git = {
+ enable = true,
+ ignore = false,
+ timeout = 500,
+},
+ renderer = {
+ root_folder_modifier = ":t",
+ icons = {
+ glyphs = {
+ default = "",
+ symlink = "",
+ folder = {
+ arrow_open = "",
+ arrow_closed = "",
+ default = "",
+ open = "",
+ empty = "",
+ empty_open = "",
+ symlink = "",
+ symlink_open = "",
+ },
+ git = {
+ unstaged = "",
+ staged = "S",
+ unmerged = "",
+ renamed = "➜",
+ untracked = "U",
+ deleted = "",
+ ignored = "◌",
+ },
+ },
+ },
+ },
+ diagnostics = {
+ enable = true,
+ show_on_dirs = true,
+ icons = {
+ hint = "",
+ info = "",
+ warning = "",
+ error = "",
+ },
+ },
+ view = {
+ width = 30,
+ --height = 30,
+ 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") },
+ -- { key = "u", action = "dir_up" },
+ -- },
+ --},
+ },
+})