Clean (#3006)
* refactor(cmp) : use cmp module from ui repo https://github.com/NvChad/ui/commit/c4576d8b5bbb6305de53ec017cd6ffad863c98ee I moved it to the ui repo so non nvchad users could achieve the CMP look from NvChad * remove: <leader>cc blankline mapping * replace: nvim-colorizer plugin with ui.colorify (BREAKING CHANGE) https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua#L106 * misc: load nvchad module in config func of ui instead of plugin/ in ui repo * clean up * remove un-needed configs/lazy_nvim.lua file * rm gitsigns mappings as it gets frustrating for users to override them * rm un-needed options var in plugin configs * add branch name for ui plugin * trim some loc! * feat: use modern theme picker for <leader>th * feat: add volt plugins
This commit is contained in:
@@ -1,73 +1,16 @@
|
||||
local cmp = require "cmp"
|
||||
|
||||
dofile(vim.g.base46_cache .. "cmp")
|
||||
|
||||
local cmp_ui = require("nvconfig").ui.cmp
|
||||
local cmp_style = cmp_ui.style
|
||||
|
||||
local field_arrangement = {
|
||||
atom = { "kind", "abbr", "menu" },
|
||||
atom_colored = { "kind", "abbr", "menu" },
|
||||
}
|
||||
|
||||
local formatting_style = {
|
||||
-- default fields order i.e completion word + item.kind + item.kind icons
|
||||
fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" },
|
||||
|
||||
format = function(_, item)
|
||||
local icons = require "nvchad.icons.lspkind"
|
||||
local icon = (cmp_ui.icons and icons[item.kind]) or ""
|
||||
|
||||
if cmp_style == "atom" or cmp_style == "atom_colored" then
|
||||
icon = " " .. icon .. " "
|
||||
item.menu = cmp_ui.lspkind_text and " (" .. item.kind .. ")" or ""
|
||||
item.kind = icon
|
||||
else
|
||||
icon = cmp_ui.lspkind_text and (" " .. icon .. " ") or icon
|
||||
item.kind = string.format("%s %s", icon, cmp_ui.lspkind_text and item.kind or "")
|
||||
end
|
||||
|
||||
return item
|
||||
end,
|
||||
}
|
||||
|
||||
local function border(hl_name)
|
||||
return {
|
||||
{ "╭", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "╮", hl_name },
|
||||
{ "│", hl_name },
|
||||
{ "╯", hl_name },
|
||||
{ "─", hl_name },
|
||||
{ "╰", hl_name },
|
||||
{ "│", hl_name },
|
||||
}
|
||||
end
|
||||
local cmp = require "cmp"
|
||||
|
||||
local options = {
|
||||
completion = {
|
||||
completeopt = "menu,menuone",
|
||||
},
|
||||
completion = { completeopt = "menu,menuone" },
|
||||
|
||||
window = {
|
||||
completion = {
|
||||
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
|
||||
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None",
|
||||
scrollbar = false,
|
||||
},
|
||||
documentation = {
|
||||
border = border "CmpDocBorder",
|
||||
winhighlight = "Normal:CmpDoc",
|
||||
},
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
formatting = formatting_style,
|
||||
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
@@ -101,6 +44,7 @@ local options = {
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
@@ -110,8 +54,4 @@ local options = {
|
||||
},
|
||||
}
|
||||
|
||||
if cmp_style ~= "atom" and cmp_style ~= "atom_colored" then
|
||||
options.window.completion.border = border "CmpBorder"
|
||||
end
|
||||
|
||||
return options
|
||||
return vim.tbl_deep_extend("force", options, require "nvchad.cmp")
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
dofile(vim.g.base46_cache .. "git")
|
||||
|
||||
local options = {
|
||||
return {
|
||||
signs = {
|
||||
delete = { text = "" },
|
||||
changedelete = { text = "" },
|
||||
},
|
||||
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function opts(desc)
|
||||
return { buffer = bufnr, desc = desc }
|
||||
end
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", "<leader>rh", gs.reset_hunk, opts "Reset Hunk")
|
||||
map("n", "<leader>ph", gs.preview_hunk, opts "Preview Hunk")
|
||||
map("n", "<leader>gb", gs.blame_line, opts "Blame Line")
|
||||
end,
|
||||
}
|
||||
|
||||
return options
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -19,10 +19,7 @@ M.on_attach = function(_, bufnr)
|
||||
end, opts "List workspace folders")
|
||||
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||
|
||||
map("n", "<leader>ra", function()
|
||||
require "nvchad.lsp.renamer"()
|
||||
end, opts "NvRenamer")
|
||||
map("n", "<leader>ra", require "nvchad.lsp.renamer", opts "NvRenamer")
|
||||
|
||||
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action")
|
||||
map("n", "gr", vim.lsp.buf.references, opts "Show references")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dofile(vim.g.base46_cache .. "mason")
|
||||
|
||||
local options = {
|
||||
return {
|
||||
PATH = "skip",
|
||||
|
||||
ui = {
|
||||
@@ -13,5 +13,3 @@ local options = {
|
||||
|
||||
max_concurrent_installers = 10,
|
||||
}
|
||||
|
||||
return options
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dofile(vim.g.base46_cache .. "nvimtree")
|
||||
|
||||
local options = {
|
||||
return {
|
||||
filters = { dotfiles = false },
|
||||
disable_netrw = true,
|
||||
hijack_cursor = true,
|
||||
@@ -32,5 +32,3 @@ local options = {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return options
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dofile(vim.g.base46_cache .. "telescope")
|
||||
|
||||
local options = {
|
||||
return {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
@@ -22,5 +22,3 @@ local options = {
|
||||
extensions_list = { "themes", "terms" },
|
||||
extensions = {},
|
||||
}
|
||||
|
||||
return options
|
||||
|
||||
@@ -3,7 +3,7 @@ pcall(function()
|
||||
dofile(vim.g.base46_cache .. "treesitter")
|
||||
end)
|
||||
|
||||
local options = {
|
||||
return {
|
||||
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
|
||||
|
||||
highlight = {
|
||||
@@ -13,5 +13,3 @@ local options = {
|
||||
|
||||
indent = { enable = true },
|
||||
}
|
||||
|
||||
return options
|
||||
|
||||
Reference in New Issue
Block a user