refactor: add utils to the global scope
This commit is contained in:
parent
8571787d70
commit
5a1240be82
19 changed files with 41 additions and 45 deletions
|
|
@ -72,7 +72,7 @@ options.buttons = {
|
|||
},
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "goolord/alpha-nvim")
|
||||
options = nvchad.load_override(options, "goolord/alpha-nvim")
|
||||
|
||||
-- dynamic header padding
|
||||
local fn = vim.fn
|
||||
|
|
|
|||
|
|
@ -65,6 +65,6 @@ local options = {
|
|||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "akinsho/bufferline.nvim")
|
||||
options = nvchad.load_override(options, "akinsho/bufferline.nvim")
|
||||
|
||||
bufferline.setup(options)
|
||||
|
|
|
|||
|
|
@ -93,6 +93,6 @@ local options = {
|
|||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "hrsh7th/nvim-cmp")
|
||||
options = nvchad.load_override(options, "hrsh7th/nvim-cmp")
|
||||
|
||||
cmp.setup(options)
|
||||
|
|
|
|||
|
|
@ -118,6 +118,6 @@ local options = {
|
|||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "kyazdani42/nvim-web-devicons")
|
||||
options = nvchad.load_override(options, "kyazdani42/nvim-web-devicons")
|
||||
|
||||
devicons.setup(options)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ local options = {
|
|||
max_concurrent_installers = 20,
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "williamboman/nvim-lsp-installer")
|
||||
options = nvchad.load_override(options, "williamboman/nvim-lsp-installer")
|
||||
|
||||
lsp_installer.setup(options)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ lspconfig.sumneko_lua.setup {
|
|||
}
|
||||
|
||||
-- requires a file containing user's lspconfigs
|
||||
local addlsp_confs = require("core.utils").load_config().plugins.options.lspconfig.setup_lspconf
|
||||
local addlsp_confs = nvchad.load_config().plugins.options.lspconfig.setup_lspconf
|
||||
|
||||
if #addlsp_confs ~= 0 then
|
||||
require(addlsp_confs).setup_lsp(M.on_attach, capabilities)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,6 @@ local options = {
|
|||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "kyazdani42/nvim-tree.lua")
|
||||
options = nvchad.load_override(options, "kyazdani42/nvim-tree.lua")
|
||||
|
||||
nvimtree.setup(options)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ local options = {
|
|||
enable_new_mappings = true,
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "NvChad/nvterm")
|
||||
options = nvchad.load_override(options, "NvChad/nvterm")
|
||||
|
||||
nvterm.setup(options)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ M.better_escape = function()
|
|||
keys = "<Esc>",
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "max397574/better-escape.nvim")
|
||||
options = nvchad.load_override(options, "max397574/better-escape.nvim")
|
||||
escape.setup(options)
|
||||
end
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ M.blankline = function()
|
|||
show_first_indent_level = false,
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "lukas-reineke/indent-blankline.nvim")
|
||||
options = nvchad.load_override(options, "lukas-reineke/indent-blankline.nvim")
|
||||
blankline.setup(options)
|
||||
end
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ M.colorizer = function()
|
|||
},
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "NvChad/nvim-colorizer.lua")
|
||||
options = nvchad.load_override(options, "NvChad/nvim-colorizer.lua")
|
||||
|
||||
colorizer.setup(options["filetypes"], options["user_default_options"])
|
||||
vim.cmd "ColorizerReloadAllBuffers"
|
||||
|
|
@ -149,7 +149,7 @@ M.signature = function()
|
|||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "ray-x/lsp_signature.nvim")
|
||||
options = nvchad.load_override(options, "ray-x/lsp_signature.nvim")
|
||||
lsp_signature.setup(options)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,7 @@ options.icon_styles = {
|
|||
},
|
||||
}
|
||||
|
||||
options.separator_style =
|
||||
options.icon_styles[require("core.utils").load_config().plugins.options.statusline.separator_style]
|
||||
options.separator_style = options.icon_styles[nvchad.load_config().plugins.options.statusline.separator_style]
|
||||
|
||||
options.main_icon = {
|
||||
provider = options.separator_style.main_icon,
|
||||
|
|
@ -345,7 +344,7 @@ options.current_line = {
|
|||
},
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "feline-nvim/feline.nvim")
|
||||
options = nvchad.load_override(options, "feline-nvim/feline.nvim")
|
||||
|
||||
local function add_table(tbl, inject)
|
||||
if inject then
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ local options = {
|
|||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "nvim-telescope/telescope.nvim")
|
||||
options = nvchad.load_override(options, "nvim-telescope/telescope.nvim")
|
||||
telescope.setup(options)
|
||||
|
||||
-- load extensions
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ local options = {
|
|||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "nvim-treesitter/nvim-treesitter")
|
||||
options = nvchad.load_override(options, "nvim-treesitter/nvim-treesitter")
|
||||
|
||||
treesitter.setup(options)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local plugin_settings = require("core.utils").load_config().plugins
|
||||
local plugin_settings = nvchad.load_config().plugins
|
||||
local present, packer = pcall(require, plugin_settings.options.packer.init_file)
|
||||
|
||||
if not present then
|
||||
|
|
@ -87,7 +87,7 @@ local plugins = {
|
|||
require("plugins.configs.others").gitsigns()
|
||||
end,
|
||||
setup = function()
|
||||
require("core.utils").packer_lazy_load "gitsigns.nvim"
|
||||
nvchad.packer_lazy_load "gitsigns.nvim"
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ local plugins = {
|
|||
["williamboman/nvim-lsp-installer"] = {
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.utils").packer_lazy_load "nvim-lsp-installer"
|
||||
nvchad.packer_lazy_load "nvim-lsp-installer"
|
||||
-- reload the current file so lsp actually starts for it
|
||||
vim.defer_fn(function()
|
||||
vim.cmd 'if &ft == "packer" | echo "" | else | silent! e %'
|
||||
|
|
@ -123,7 +123,7 @@ local plugins = {
|
|||
["andymass/vim-matchup"] = {
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.utils").packer_lazy_load "vim-matchup"
|
||||
nvchad.packer_lazy_load "vim-matchup"
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
@ -229,9 +229,9 @@ local plugins = {
|
|||
},
|
||||
}
|
||||
|
||||
plugins = require("core.utils").remove_default_plugins(plugins)
|
||||
plugins = nvchad.remove_default_plugins(plugins)
|
||||
-- merge user plugin table & default plugin table
|
||||
plugins = require("core.utils").plugin_list(plugins)
|
||||
plugins = nvchad.plugin_list(plugins)
|
||||
|
||||
return packer.startup(function(use)
|
||||
for _, v in pairs(plugins) do
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ if not present then
|
|||
end
|
||||
end
|
||||
|
||||
local user_snapshot = require("core.utils").load_config().snapshot
|
||||
local user_snapshot = nvchad.load_config().snapshot
|
||||
|
||||
packer.init {
|
||||
display = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue