From 6f90d902b9f415e02fb0510d27e2f95bd7ede09c Mon Sep 17 00:00:00 2001
From: Alexander Gehrke <github@qwertyuiop.de>
Date: Wed, 8 Mar 2023 18:44:47 +0100
Subject: [PATCH] Nice icons for completions

---
 after/plugin/cmp.lua | 9 +++++++++
 packages.vim         | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua
index ed891c9..885d28e 100644
--- a/after/plugin/cmp.lua
+++ b/after/plugin/cmp.lua
@@ -1,4 +1,5 @@
 local cmp = require('cmp')
+local lspkind = require('lspkind')
 
 cmp.setup({
   snippet = {
@@ -32,6 +33,14 @@ cmp.setup({
     { name = 'buffer' },
     --{ name = 'path' },
   }),
+  formatting = {
+    format = lspkind.cmp_format({
+      mode = 'symbol_text', -- show only symbol annotations
+      maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
+      ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
+      symbol_map = { Copilot = "" },
+    })
+  },
 })
 
 --cmp.setup.cmdline({ '/', '?' }, {
diff --git a/packages.vim b/packages.vim
index 15ab6ef..04ef77a 100644
--- a/packages.vim
+++ b/packages.vim
@@ -41,6 +41,8 @@ Plug 'nvim-lua/plenary.nvim'
 Plug 'scalameta/nvim-metals'
 Plug 'williamboman/mason.nvim'
 Plug 'williamboman/mason-lspconfig.nvim'
+Plug 'onsails/lspkind.nvim'
+
 
 Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
 Plug 'nvim-lua/lsp-status.nvim'