From 621ca82a77a0ab5986595a4207866fc25add600d Mon Sep 17 00:00:00 2001 From: Matthew Leong Date: Sun, 29 May 2022 13:25:40 -0700 Subject: [PATCH] feat(NvimTree): Update setup config --- lua/cosmic/plugins/nvim-tree/init.lua | 43 +++++++++++++-------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/lua/cosmic/plugins/nvim-tree/init.lua b/lua/cosmic/plugins/nvim-tree/init.lua index 50959e5..a786484 100644 --- a/lua/cosmic/plugins/nvim-tree/init.lua +++ b/lua/cosmic/plugins/nvim-tree/init.lua @@ -1,36 +1,20 @@ local config = require('cosmic.core.user') -local g = vim.g local icons = require('cosmic.theme.icons') local u = require('cosmic.utils') local augroup_name = 'CosmicNvimNvimTree' local group = vim.api.nvim_create_augroup(augroup_name, { clear = true }) --- settings -g.nvim_tree_git_hl = 1 -g.nvim_tree_refresh_wait = 300 - -g.nvim_tree_special_files = {} - -g.nvim_tree_icons = { - default = '', - symlink = icons.symlink, - git = icons.git, - folder = icons.folder, - - lsp = { - hint = icons.hint, - info = icons.info, - warning = icons.warn, - error = icons.error, - }, -} - -g.nvim_tree_respect_buf_cwd = 1 - -- set up args local args = { + respect_buf_cwd = true, diagnostics = { enable = true, + icons = { + hint = icons.hint, + info = icons.info, + warning = icons.warn, + error = icons.error, + }, }, ignore_ft_on_setup = { 'startify', @@ -48,8 +32,21 @@ local args = { git = { ignore = true, }, + renderer = { + highlight_git = true, + special_files = {}, + icons = { + glyphs = { + default = '', + symlink = icons.symlink, + git = icons.git, + folder = icons.folder, + }, + }, + }, } +-- Autoclose nvim is nvim-tree is only buffer open vim.api.nvim_create_autocmd('BufEnter', { command = [[if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]], group = group,