feat(NvimTree): Update setup config
This commit is contained in:
parent
ebd949c7d1
commit
621ca82a77
1 changed files with 20 additions and 23 deletions
|
@ -1,36 +1,20 @@
|
||||||
local config = require('cosmic.core.user')
|
local config = require('cosmic.core.user')
|
||||||
local g = vim.g
|
|
||||||
local icons = require('cosmic.theme.icons')
|
local icons = require('cosmic.theme.icons')
|
||||||
local u = require('cosmic.utils')
|
local u = require('cosmic.utils')
|
||||||
local augroup_name = 'CosmicNvimNvimTree'
|
local augroup_name = 'CosmicNvimNvimTree'
|
||||||
local group = vim.api.nvim_create_augroup(augroup_name, { clear = true })
|
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
|
-- set up args
|
||||||
local args = {
|
local args = {
|
||||||
|
respect_buf_cwd = true,
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
icons = {
|
||||||
|
hint = icons.hint,
|
||||||
|
info = icons.info,
|
||||||
|
warning = icons.warn,
|
||||||
|
error = icons.error,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
ignore_ft_on_setup = {
|
ignore_ft_on_setup = {
|
||||||
'startify',
|
'startify',
|
||||||
|
@ -48,8 +32,21 @@ local args = {
|
||||||
git = {
|
git = {
|
||||||
ignore = true,
|
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', {
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
command = [[if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]],
|
command = [[if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]],
|
||||||
group = group,
|
group = group,
|
||||||
|
|
Loading…
Add table
Reference in a new issue