Skip to content

Instantly share code, notes, and snippets.

View jsr-p's full-sized avatar
🎯
Focusing

jsr-p

🎯
Focusing
  • SODAS KU
  • Copenhagen
View GitHub Profile
@jsr-p
jsr-p / before.lua
Last active February 17, 2023 18:15
lua function akin to https://github.com/onsails/lspkind.nvim/pull/30 but for Ultisnips
local cmp = require('cmp')
local lspkind = require('lspkind')
--- Function to preview snippet before completion with nvim-cmp
---@param entry cmp.Entry
---@param vim_item vim.CompletedItem
---@return vim.CompletedItem
function CmpBefore(entry, vim_item)
if entry.completion_item.snippet then
local snippet_value = entry.completion_item.snippet.value