mirror of
https://github.com/pnx/dotfiles
synced 2026-06-17 11:30:02 +02:00
new nvim config
This commit is contained in:
parent
4b730d3924
commit
7388c9bfd3
78 changed files with 1291 additions and 43 deletions
21
nvim-old/lua/utils/lspkind.lua
Normal file
21
nvim-old/lua/utils/lspkind.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
local M = {}
|
||||
|
||||
-- Create format function.
|
||||
function M.format(config)
|
||||
return function(entry, vim_item)
|
||||
-- Devicons for files
|
||||
if vim.tbl_contains({ 'path' }, entry.source.name) then
|
||||
local icon, hl_group = require('nvim-web-devicons').get_icon(entry:get_completion_item().label)
|
||||
if icon then
|
||||
vim_item.kind = icon
|
||||
vim_item.kind_hl_group = hl_group
|
||||
return vim_item
|
||||
end
|
||||
end
|
||||
|
||||
return require('lspkind').cmp_format(config)(entry, vim_item)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue