From 5fed75607d206f5bb7786cf4a1a8193495396bb4 Mon Sep 17 00:00:00 2001 From: Joost Agterhoek Date: Mon, 14 Jul 2025 15:56:17 +0200 Subject: [PATCH] added emoji (still doesn't work though) --- lua/plugins/blink-cmp.lua | 52 ++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua index d14a403..6e243de 100644 --- a/lua/plugins/blink-cmp.lua +++ b/lua/plugins/blink-cmp.lua @@ -4,6 +4,9 @@ return { event = "VimEnter", version = "1.*", dependencies = { + -- "allaman/emoji.nvim", + -- "saghen/blink.compat", + "moyiz/blink-emoji.nvim", "ribru17/blink-cmp-spell", -- Snippet Engine { @@ -18,9 +21,9 @@ return { end return "make install_jsregexp" end)(), - config = function() - require 'snippets' - end, + config = function() + require("snippets") + end, dependencies = { -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: @@ -80,15 +83,42 @@ return { }, sources = { - default = { "lsp", "path", "snippets", "spell", "lazydev" }, + -- removed "spell" from default list + default = { "lsp", "path", "snippets", "lazydev", "emoji" }, providers = { - spell = { - name = 'Spell', - module = 'blink-cmp-spell', - opts = { - max_entries = 5 - } - }, + spell = { + name = "Spell", + module = "blink-cmp-spell", + opts = { + max_entries = 5, + }, + }, + emoji = { + name = "Emoji", + module = "blink-emoji", + score_offset = 15, + opts = { + insert = true, + ---@type string|table|fun():table + trigger = function() + return { ":" } + end, + }, + should_show_items = function() + return vim.tbl_contains({ "gitcommit", "markdown" }, vim.o.filetype) + end, + }, + -- emoji = { + -- name = "emoji", + -- module = "blink.compat.source", + -- transform_items = function(ctx, items) + -- local kind = require("blink.cmp.types").CompletionItemKind.Text + -- for i = 1, #items do + -- items[i].kind = kind + -- end + -- return items + -- end, + -- }, lazydev = { module = "lazydev.integrations.blink", score_offset = 100 }, }, },