diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index b149882..e8518e6 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -1,6 +1,6 @@ vim.opt.completeopt = "menuone,noselect" -local lspkind = require "lspkind" +local lspkind = require "plugins.configs.lspkind_icons" local luasnip = require "luasnip" -- nvim-cmp setup @@ -13,7 +13,8 @@ cmp.setup { }, formatting = { format = function(entry, vim_item) - vim_item.kind = lspkind.presets.default[vim_item.kind] .. " " .. vim_item.kind + -- load lspkind icons + vim_item.kind = string.format("%s %s", lspkind.icons[vim_item.kind], vim_item.kind) vim_item.menu = ({ nvim_lsp = "[LSP]", diff --git a/lua/plugins/configs/lspkind_icons.lua b/lua/plugins/configs/lspkind_icons.lua new file mode 100644 index 0000000..dd775b7 --- /dev/null +++ b/lua/plugins/configs/lspkind_icons.lua @@ -0,0 +1,31 @@ +local M = {} + +M.icons = { + Text = "", + Method = "", + Function = "", + Constructor = "", + Field = "ﰠ", + Variable = "", + Class = "ﴯ", + Interface = "", + Module = "", + Property = "ﰠ", + Unit = "塞", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "פּ", + Event = "", + Operator = "", + TypeParameter = "", +} + +return M diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 11dd0ac..51fab2e 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -161,15 +161,15 @@ return packer.startup(function() end, } - use { - "onsails/lspkind-nvim", - disable = not plugin_status.lspkind, - after = "LuaSnip", - config = function() - require("plugins.configs.others").lspkind() - end, - } - + -- use { + -- "onsails/lspkind-nvim", + -- disable = not plugin_status.lspkind, + -- after = "LuaSnip", + -- config = function() + -- require("plugins.configs.others").lspkind() + -- end, + -- } + -- use { "jdhao/better-escape.vim", disable = not plugin_status.esc_insertmode, @@ -198,7 +198,7 @@ return packer.startup(function() config = function() require "plugins.configs.cmp" end, - after = "lspkind-nvim", + after = "LuaSnip", } use {