Reshape cmp box
This commit is contained in:
20
nvim/lua/configs/cmp.lua
Normal file
20
nvim/lua/configs/cmp.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local cmp_ui = require("nvconfig").ui.cmp
|
||||
|
||||
return {
|
||||
formatting = {
|
||||
-- default fields order i.e completion word + item.kind + item.kind icons
|
||||
fields = { "abbr", "kind" },
|
||||
|
||||
format = function(_, item)
|
||||
local icons = require "nvchad.icons.lspkind"
|
||||
local icon = (cmp_ui.icons and icons[item.kind]) or ""
|
||||
|
||||
icon = cmp_ui.lspkind_text and (" " .. icon .. " ") or icon
|
||||
item.kind = string.format("%s %s", icon, cmp_ui.lspkind_text and item.kind or "")
|
||||
|
||||
item.abbr = item.abbr:match "[^(]+"
|
||||
item.menu = ""
|
||||
return item
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -43,8 +43,8 @@ map("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" })
|
||||
map("n", "gr", vim.lsp.buf.references, { desc = "Show references" })
|
||||
map("n", "<leader>ld", vim.diagnostic.setloclist, { desc = "LSP Diagnostic loclist" })
|
||||
map("n", "<leader>lr", function()
|
||||
require "nvchad.lsp.renamer"()
|
||||
end, {desc = "NvRenamer"})
|
||||
require "nvchad.lsp.renamer"()
|
||||
end, { desc = "NvRenamer" })
|
||||
|
||||
-- Git
|
||||
map("n", "<leader>gm", "<cmd>Telescope git_commits<CR>", { desc = "telescope git commits" })
|
||||
@@ -81,4 +81,3 @@ cmp.setup {
|
||||
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select }, { "i" }),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ vim.opt.fillchars = {
|
||||
foldclose = "",
|
||||
}
|
||||
|
||||
|
||||
vim.o.pumheight = 10
|
||||
|
||||
@@ -27,4 +27,8 @@ return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = require "configs.nvim-tree",
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = require("configs.cmp"),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ return {
|
||||
"kevinhwang91/nvim-ufo",
|
||||
config = function()
|
||||
require("ufo").setup {
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
provider_selector = function(_, _, _)
|
||||
return { "treesitter", "indent" }
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user