rice cmp-nvim

related  to 15a1b910a0
This commit is contained in:
siduck 2022-05-03 22:57:16 +05:30
parent 174873b41f
commit 854534f54c
2 changed files with 29 additions and 8 deletions

View file

@ -6,23 +6,44 @@ end
vim.opt.completeopt = "menuone,noselect"
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_window = require "cmp.utils.window"
function cmp_window:has_scrollbar()
return false
end
local options = {
window = {
completion = {
border = border "CmpBorder",
},
documentation = {
border = border "CmpDocBorder",
},
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
formatting = {
format = function(entry, vim_item)
format = function(_, vim_item)
local icons = require "plugins.configs.lspkind_icons"
vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind)
vim_item.menu = ({
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
buffer = "[BUF]",
})[entry.source.name]
return vim_item
end,
},

View file

@ -1,7 +1,7 @@
local icons = {
Text = "",
Method = "",
Function = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",