From dfde600c7a7f875a4e470aa8ea3fa72c972869d0 Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@arity.se>
Date: Tue, 21 Jan 2025 22:30:38 +0100
Subject: [PATCH 1/3] nvim: blink-compat is now in nixpkgs

---
 home/common/nvim/default.nix | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix
index 57e68e6..b681cdc 100644
--- a/home/common/nvim/default.nix
+++ b/home/common/nvim/default.nix
@@ -46,6 +46,7 @@ in
     ];
 
     plugins = with pkgs.vimPlugins; [
+      blink-compat
       friendly-snippets
       go-nvim
       targets-vim
@@ -80,22 +81,6 @@ in
         config = lib.fileContents ./blink-cmp.lua;
       }
 
-      {
-        plugin = pkgs.vimUtils.buildVimPlugin {
-          name = "blink.compat";
-          src = pkgs.fetchFromGitHub {
-            owner = "saghen";
-            repo = "blink.compat";
-            rev = "5ca8848c8cc32abdc980e5db4f0eb7bb8fbf84dc"; # Dec 25, 2024
-            hash = "sha256-tFQeKyqdo3mvptYnWxKhTpI4ROFNQ6u3P8cLqtlsozw=";
-          };
-        };
-        type = "lua";
-        config = ''
-          require('blink.compat').setup()
-        '';
-      }
-
       {
         plugin = pkgs.vimUtils.buildVimPlugin {
           name = "inlay-hints";

From df7f12c94c1cb08a9507c63876b52dca3d1df4af Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@arity.se>
Date: Tue, 21 Jan 2025 22:30:38 +0100
Subject: [PATCH 2/3] nvim: allow blink completion menu to go downward if there
 is not enough space north

---
 home/common/nvim/blink-cmp.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/home/common/nvim/blink-cmp.lua b/home/common/nvim/blink-cmp.lua
index 8ae4f6c..a719718 100644
--- a/home/common/nvim/blink-cmp.lua
+++ b/home/common/nvim/blink-cmp.lua
@@ -29,7 +29,7 @@ require 'blink-cmp'.setup({
     menu = {
       auto_show = true,
       border = 'rounded',
-      direction_priority = { 'n' },
+      direction_priority = { 'n', 's' },
       draw = {
         components = {
           kind_icon = {

From fdb2fa86e4e004d879535f4eb8fc110760ace9be Mon Sep 17 00:00:00 2001
From: Daniel Lundin <dln@arity.se>
Date: Tue, 21 Jan 2025 22:30:38 +0100
Subject: [PATCH 3/3] =?UTF-8?q?nvim:=20add=20blink-emoji=20completion=20?=
 =?UTF-8?q?=F0=9F=9A=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 home/common/nvim/blink-cmp.lua | 15 ++++++++++++---
 home/common/nvim/default.nix   |  1 +
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/home/common/nvim/blink-cmp.lua b/home/common/nvim/blink-cmp.lua
index a719718..113fda6 100644
--- a/home/common/nvim/blink-cmp.lua
+++ b/home/common/nvim/blink-cmp.lua
@@ -61,9 +61,18 @@ require 'blink-cmp'.setup({
   },
 
   sources = {
-    default = { 'lsp' },
+    default = {
+      'lsp',
+      'emoji',
+    },
     cmdline = {},
-    providers = {},
+    providers = {
+      emoji = {
+        module = "blink-emoji",
+        name = "Emoji",
+        score_offset = 1,
+        opts = { insert = true },
+      }
+    },
   },
-
 })
diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix
index b681cdc..e5adcd9 100644
--- a/home/common/nvim/default.nix
+++ b/home/common/nvim/default.nix
@@ -47,6 +47,7 @@ in
 
     plugins = with pkgs.vimPlugins; [
       blink-compat
+      blink-emoji-nvim
       friendly-snippets
       go-nvim
       targets-vim