summary refs log tree commit diff stats
path: root/hm
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2024-04-07 17:51:36 +0200
committerSilas Schöffel <sils@sils.li>2024-04-07 17:51:36 +0200
commit6ee1d5f187f5e25975e4be57991daadde18b7ec9 (patch)
tree871c6ded26e1b39c84951ff323a4665720bfc2a6 /hm
parentflake.lock: update (diff)
downloadnix-config-6ee1d5f187f5e25975e4be57991daadde18b7ec9.tar.gz
nix-config-6ee1d5f187f5e25975e4be57991daadde18b7ec9.zip
nixvim: tweak completion settings
I'm not entirely sure if they have any effect at all.
Diffstat (limited to 'hm')
-rw-r--r--hm/nixvim/config.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/hm/nixvim/config.nix b/hm/nixvim/config.nix
index 5ce397c..24e5a33 100644
--- a/hm/nixvim/config.nix
+++ b/hm/nixvim/config.nix
@@ -8,6 +8,8 @@ pkgs: {
 
     textwidth = 83;
     linebreak = true;
+
+    completeopt = ["menu" "menuone" "noselect"];
   };
   keymaps = [
     {
@@ -56,6 +58,7 @@ pkgs: {
     cmp = {
       enable = true;
       settings = {
+        snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
         mappings = {
           "<C-Space>" = "cmp.mapping.complete()";
           "<C-d>" = "cmp.mapping.scroll_docs(-4)";
@@ -68,12 +71,16 @@ pkgs: {
         sources = [
           {name = "nvim_lsp";}
           {name = "path";}
-          {name = "buffer";}
+          {
+            name = "buffer";
+            option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
+          }
           {name = "git";}
           {name = "conventionalcommits";}
         ];
       };
     };
+    cmp-path.enable = true;
     coq-nvim = {
       enable = false;
       settings = {
@@ -97,9 +104,25 @@ pkgs: {
         java-language-server.enable = true;
       };
     };
+    lspkind = {
+      enable = true;
+
+      cmp = {
+        enable = true;
+        menu = {
+          nvim_lsp = "[LSP]";
+          nvim_lua = "[api]";
+          path = "[path]";
+          luasnip = "[snip]";
+          buffer = "[buffer]";
+          neorg = "[neorg]";
+        };
+      };
+    };
     lsp-format = {
       enable = true;
     };
+    luasnip.enable = true;
     quickmath.enable = true;
     treesitter = {
       enable = true;