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" 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 = { local options = {
window = {
completion = {
border = border "CmpBorder",
},
documentation = {
border = border "CmpDocBorder",
},
},
snippet = { snippet = {
expand = function(args) expand = function(args)
require("luasnip").lsp_expand(args.body) require("luasnip").lsp_expand(args.body)
end, end,
}, },
formatting = { formatting = {
format = function(entry, vim_item) format = function(_, vim_item)
local icons = require "plugins.configs.lspkind_icons" local icons = require "plugins.configs.lspkind_icons"
vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind) 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 return vim_item
end, end,
}, },

View File

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