From e63498414aac8c2f07e27aa4b176a2b3709c4254 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Mon, 14 Feb 2022 00:13:50 +0100 Subject: [PATCH] vim: fix nvim-tree configuration --- config/nvim/lua/fs/config/nvim-tree.lua | 58 ++++++++++++------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/config/nvim/lua/fs/config/nvim-tree.lua b/config/nvim/lua/fs/config/nvim-tree.lua index 9d7b7a1..dbbd408 100644 --- a/config/nvim/lua/fs/config/nvim-tree.lua +++ b/config/nvim/lua/fs/config/nvim-tree.lua @@ -11,37 +11,35 @@ local function set_globals(tbl) end end -local global_opts ={ - add_trailing = 1, -- add trailing / to folders - group_empty = 1, -- folders that contain only one folder are grouped - indent_markers = 1, -- show indent markers - git_hl = 1, -- enable highlight based on git attributes - - icons = { - default = '', -- default icon for files - symlink = '', -- default icon for symlinks - }, -} - -local nvim_tree_config = { - auto_close = true, -- close vim if tree is the last window - - git = { - ignore = false, -- don't hide files from .gitignore - }, - - view = { - width = 35, -- a little wider than the default 30 - }, - - filters = { - dotfiles = false, -- show files starting with a . - custom = { '.git' }, -- don't show .git directory - }, -} - local config = function() - require'nvim-tree'.setup(nvim_tree_config) + set_globals { + add_trailing = 1, -- add trailing / to folders + group_empty = 1, -- folders that contain only one folder are grouped + indent_markers = 1, -- show indent markers + git_hl = 1, -- enable highlight based on git attributes + + icons = { + default = '', -- default icon for files + symlink = '', -- default icon for symlinks + }, + } + + require'nvim-tree'.setup { + auto_close = true, -- close vim if tree is the last window + + git = { + ignore = false, -- don't hide files from .gitignore + }, + + view = { + width = 35, -- a little wider than the default 30 + }, + + filters = { + dotfiles = false, -- show files starting with a . + custom = { '.git' }, -- don't show .git directory + }, + } highlight('NvimTreeSpecialFile') { fg = colors.base2 } highlight('NvimTreeIndentMarker') { fg = colors.base01 }