BREAKING CHANGE | re-implementation of custom config

This commit is contained in:
siduck 2022-04-27 21:12:28 +05:30
parent d906bb0d9c
commit adecbe719f
20 changed files with 835 additions and 1309 deletions

View file

@ -1,8 +1,14 @@
local present, nvimtree = pcall(require, "nvim-tree")
if not present then
return
end
-- globals must be set prior to requiring nvim-tree to function
local g = vim.g
g.nvim_tree_add_trailing = 0 -- append a trailing slash to folder names
g.nvim_tree_git_hl = 0
g.nvim_tree_git_hl = 1
g.nvim_tree_highlight_opened_files = 0
g.nvim_tree_root_folder_modifier = table.concat { ":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??" }
@ -34,20 +40,13 @@ g.nvim_tree_icons = {
},
}
local present, nvimtree = pcall(require, "nvim-tree")
if not present then
return
end
local default = {
local options = {
filters = {
dotfiles = false,
},
disable_netrw = true,
hijack_netrw = true,
ignore_ft_on_setup = { "dashboard" },
auto_close = false,
open_on_tab = false,
hijack_cursor = true,
hijack_unnamed_buffer_when_opening = false,
@ -57,7 +56,6 @@ local default = {
update_cwd = false,
},
view = {
allow_resize = true,
side = "left",
width = 25,
hide_root_folder = true,
@ -74,17 +72,11 @@ local default = {
renderer = {
indent_markers = {
enable = true,
}
}
},
},
}
local M = {}
-- check for any override
options = require("core.utils").load_override(options, "kyazdani42/nvim-tree.lua")
M.setup = function(override_flag)
if override_flag then
default = require("core.utils").tbl_override_req("nvim_tree", default)
end
nvimtree.setup(default)
end
return M
nvimtree.setup(options)