BREAKING CHANGE: utilize lazy.nvim fully, remove un-needed functions
This commit is contained in:
parent
5246faa09a
commit
6590372791
9 changed files with 140 additions and 217 deletions
|
|
@ -115,7 +115,4 @@ if cmp_style ~= "atom" and cmp_style ~= "atom_colored" then
|
|||
options.window.completion.border = border "CmpBorder"
|
||||
end
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "hrsh7th/nvim-cmp")
|
||||
|
||||
cmp.setup(options)
|
||||
return options
|
||||
|
|
|
|||
|
|
@ -27,10 +27,4 @@ local options = {
|
|||
max_concurrent_installers = 10,
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "williamboman/mason.nvim")
|
||||
|
||||
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
||||
vim.cmd("MasonInstall " .. table.concat(options.ensure_installed, " "))
|
||||
end, {})
|
||||
|
||||
require("mason").setup(options)
|
||||
return options
|
||||
|
|
|
|||
|
|
@ -75,8 +75,6 @@ local options = {
|
|||
},
|
||||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "nvim-tree/nvim-tree.lua")
|
||||
vim.g.nvimtree_side = options.view.side
|
||||
|
||||
require("nvim-tree").setup(options)
|
||||
return options
|
||||
|
|
|
|||
|
|
@ -1,62 +1,24 @@
|
|||
local M = {}
|
||||
|
||||
local load_override = require("core.utils").load_override
|
||||
local utils = require "core.utils"
|
||||
|
||||
M.autopairs = function()
|
||||
local options = {
|
||||
fast_wrap = {},
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
}
|
||||
|
||||
options = load_override(options, "windwp/nvim-autopairs")
|
||||
require("nvim-autopairs").setup(options)
|
||||
|
||||
-- setup cmp for autopairs
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end
|
||||
|
||||
M.blankline = function()
|
||||
dofile(vim.g.base46_cache .. "blankline")
|
||||
|
||||
local options = {
|
||||
indentLine_enabled = 1,
|
||||
filetype_exclude = {
|
||||
"help",
|
||||
"terminal",
|
||||
"lazy",
|
||||
"lspinfo",
|
||||
"TelescopePrompt",
|
||||
"TelescopeResults",
|
||||
"mason",
|
||||
"",
|
||||
},
|
||||
buftype_exclude = { "terminal" },
|
||||
show_trailing_blankline_indent = false,
|
||||
show_first_indent_level = false,
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
}
|
||||
|
||||
options = load_override(options, "lukas-reineke/indent-blankline.nvim")
|
||||
require("indent_blankline").setup(options)
|
||||
end
|
||||
|
||||
M.colorizer = function()
|
||||
local options = {}
|
||||
options = load_override(options, "NvChad/nvim-colorizer.lua")
|
||||
require("colorizer").setup(options)
|
||||
|
||||
-- execute colorizer as soon as possible
|
||||
vim.defer_fn(function()
|
||||
require("colorizer").attach_to_buffer(0)
|
||||
end, 0)
|
||||
end
|
||||
|
||||
M.comment = function()
|
||||
require("Comment").setup(load_override({}, "numToStr/Comment.nvim"))
|
||||
end
|
||||
M.blankline = {
|
||||
indentLine_enabled = 1,
|
||||
filetype_exclude = {
|
||||
"help",
|
||||
"terminal",
|
||||
"lazy",
|
||||
"lspinfo",
|
||||
"TelescopePrompt",
|
||||
"TelescopeResults",
|
||||
"mason",
|
||||
"",
|
||||
},
|
||||
buftype_exclude = { "terminal" },
|
||||
show_trailing_blankline_indent = false,
|
||||
show_first_indent_level = false,
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
}
|
||||
|
||||
M.luasnip = function()
|
||||
local options = {
|
||||
|
|
@ -64,7 +26,6 @@ M.luasnip = function()
|
|||
updateevents = "TextChanged,TextChangedI",
|
||||
}
|
||||
|
||||
options = load_override(options, "L3MON4D3/LuaSnip")
|
||||
require("luasnip").config.set_config(options)
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" }
|
||||
|
|
@ -83,9 +44,7 @@ M.luasnip = function()
|
|||
end
|
||||
|
||||
M.gitsigns = function()
|
||||
dofile(vim.g.base46_cache .. "git")
|
||||
|
||||
local options = {
|
||||
return {
|
||||
signs = {
|
||||
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
||||
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
||||
|
|
@ -98,18 +57,6 @@ M.gitsigns = function()
|
|||
utils.load_mappings("gitsigns", { buffer = bufnr })
|
||||
end,
|
||||
}
|
||||
|
||||
options = load_override(options, "lewis6991/gitsigns.nvim")
|
||||
require("gitsigns").setup(options)
|
||||
end
|
||||
|
||||
M.devicons = function()
|
||||
dofile(vim.g.base46_cache .. "devicons")
|
||||
|
||||
local options = { override = require("nvchad_ui.icons").devicons }
|
||||
options = require("core.utils").load_override(options, "nvim-tree/nvim-web-devicons")
|
||||
|
||||
require("nvim-web-devicons").setup(options)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -54,13 +54,4 @@ local options = {
|
|||
extensions_list = { "themes", "terms" },
|
||||
}
|
||||
|
||||
local telescope = require "telescope"
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "nvim-telescope/telescope.nvim")
|
||||
telescope.setup(options)
|
||||
|
||||
-- load extensions
|
||||
for _, ext in ipairs(options.extensions_list) do
|
||||
telescope.load_extension(ext)
|
||||
end
|
||||
return options
|
||||
|
|
|
|||
|
|
@ -11,7 +11,4 @@ local options = {
|
|||
indent = { enable = true },
|
||||
}
|
||||
|
||||
-- check for any override
|
||||
options = require("core.utils").load_override(options, "nvim-treesitter/nvim-treesitter")
|
||||
|
||||
require("nvim-treesitter.configs").setup(options)
|
||||
return options
|
||||
|
|
|
|||
|
|
@ -30,6 +30,4 @@ local options = {
|
|||
},
|
||||
}
|
||||
|
||||
options = require("core.utils").load_override(options, "folke/which-key.nvim")
|
||||
|
||||
require("which-key").setup(options)
|
||||
return options
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue