nvim: blink-cmp goodness

This commit is contained in:
Daniel Lundin 2024-12-11 20:15:15 +01:00
parent f26beb87bd
commit b455010624
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI
4 changed files with 151 additions and 92 deletions

View file

@ -1,6 +1,22 @@
{ {
"nodes": { "nodes": {
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1733328505, "lastModified": 1733328505,
@ -16,7 +32,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": { "flake-compat_3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -94,26 +110,23 @@
}, },
"ghostty": { "ghostty": {
"inputs": { "inputs": {
"nixpkgs-stable": [ "flake-compat": "flake-compat",
"nixpkgs" "nixpkgs-stable": "nixpkgs-stable",
], "nixpkgs-unstable": "nixpkgs-unstable",
"nixpkgs-unstable": [
"nixpkgs"
],
"zig": "zig" "zig": "zig"
}, },
"locked": { "locked": {
"lastModified": 1734275633, "lastModified": 1735271978,
"narHash": "sha256-/5Rnuouf4DrQWKc5sMjA/8Uiznp8/oCQe3YaYvp+fWU=", "narHash": "sha256-y6Ony5eq4F4E76Y2ZhALSEzBZ4GbGRVQIEScPieCDGI=",
"ref": "refs/heads/main", "owner": "ghostty-org",
"rev": "ceef2900e24944b18a6aadf5e6dd40aeef64e85d", "repo": "ghostty",
"revCount": 8271, "rev": "a8e5eef11cc67f87f445626f9ca2993373774bf8",
"type": "git", "type": "github"
"url": "ssh://git@github.com/ghostty-org/ghostty"
}, },
"original": { "original": {
"type": "git", "owner": "ghostty-org",
"url": "ssh://git@github.com/ghostty-org/ghostty" "repo": "ghostty",
"type": "github"
} }
}, },
"ghostty-hm": { "ghostty-hm": {
@ -133,7 +146,7 @@
}, },
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_3",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"neovim-nightly-overlay", "neovim-nightly-overlay",
@ -145,11 +158,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733665616, "lastModified": 1734797603,
"narHash": "sha256-+XTFXYlFJBxohhMGLDpYdEnhUNdxN8dyTA8WAd+lh2A=", "narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "d8c02f0ffef0ef39f6063731fc539d8c71eb463a", "rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -209,11 +222,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734093295, "lastModified": 1735053786,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=", "narHash": "sha256-Gm+0DcbUS338vvkwyYWms5jsWlx8z8MeQBzcnIDuIkw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8", "rev": "35b98d20ca8f4ca1f6a2c30b8a2c8bb305a36d84",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -224,7 +237,7 @@
}, },
"neovim-nightly-overlay": { "neovim-nightly-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",
@ -233,11 +246,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1734048484, "lastModified": 1735172062,
"narHash": "sha256-EtSEYNx19xzuEBJsT7yXG+nVx11CM3rvrAQAXcvG/5Q=", "narHash": "sha256-Ru+5fwMqXEoc6G1PbuTppAzxtqvj0322cBAWCb0Yhbo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "044f9a36ad620a119ebe154c26ec571a09f75039", "rev": "d05e1d754812bcd89925d845992f377faf6c4944",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -249,11 +262,11 @@
"neovim-src": { "neovim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1734000357, "lastModified": 1735157560,
"narHash": "sha256-8FO5Ca9bLEiD649b5gkQCdjpTmbPenJHpN0JBhtLpjE=", "narHash": "sha256-ndlWdGm61W3uObi8cowWqnPdJwq2FsH4GHGOQYeNSOM=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "17383870dd3b7f04eddd48ed929cc25c7e102277", "rev": "487c48ec8689b865bad04fdb87b61f5ada25da97",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -264,11 +277,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733749988, "lastModified": 1734988233,
"narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=", "narHash": "sha256-Ucfnxq1rF/GjNP3kTL+uTfgdoE9a3fxDftSfeLIS8mA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68", "rev": "de1864217bfa9b5845f465e771e0ecb48b30e02d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -280,27 +293,59 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1734017764, "lastModified": 1733423277,
"narHash": "sha256-msOfmyJSjAHgIygI/JD0Ae3JsDv4rT54Nlfr5t6MQMQ=", "narHash": "sha256-TxabjxEgkNbCGFRHgM/b9yZWlBj60gUOUnRT/wbVQR8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "64e9404f308e0f0a0d8cdd7c358f74e34802494b", "rev": "e36963a147267afc055f7cf65225958633e536bf",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.05", "ref": "release-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1735141468,
"narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1734126203, "lastModified": 1733229606,
"narHash": "sha256-0XovF7BYP50rTD2v4r55tR5MuBLet7q4xIz6Rgh3BBU=", "narHash": "sha256-FLYY5M0rpa5C2QAE3CKLYAM6TwbKicdRK6qNrSHlNrE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "71a6392e367b08525ee710a93af2e80083b5b3e2", "rev": "566e53c2ad750c84f6d31f9ccb9d00f823165550",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable_2": {
"locked": {
"lastModified": 1735268880,
"narHash": "sha256-7QEFnKkzD13SPxs+UFR5bUFN2fRw+GlL0am72ZjNre4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7cc0bff31a3a705d3ac4fdceb030a17239412210",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -312,11 +357,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1734119587, "lastModified": 1735291276,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", "narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5", "rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -333,8 +378,8 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable_2",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable_2"
} }
}, },
"systems": { "systems": {
@ -360,11 +405,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733761991, "lastModified": 1735135567,
"narHash": "sha256-s4DalCDepD22jtKL5Nw6f4LP5UwoMcPzPZgHWjAfqbQ=", "narHash": "sha256-8T3K5amndEavxnludPyfj3Z1IkcFdRpR23q+T0BVeZE=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "0ce9d149d99bc383d1f2d85f31f6ebd146e46085", "rev": "9e09d30a644c57257715902efbb3adc56c79cf28",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -0,0 +1,56 @@
require 'blink-cmp'.setup({
keymap = {
preset = 'enter',
["<PageDown>"] = { "scroll_documentation_down" },
["<PageUp>"] = { "scroll_documentation_up" },
},
completion = {
accept = {
auto_brackets = { enabled = true, },
},
documentation = {
auto_show = true,
auto_show_delay_ms = 800,
window = { border = 'rounded', },
},
ghost_text = { enabled = true },
list = {
selection = "manual",
},
menu = {
auto_show = true,
},
},
fuzzy = {
prebuilt_binaries = {
download = false
},
},
keymap = {
preset = 'super-tab',
},
signature = {
enabled = true,
window = { border = 'rounded', },
},
sources = {
default = { 'lsp', 'codeium', 'buffer' },
cmdline = {},
providers = {
codeium = {
name = "codeium",
module = 'blink.compat.source',
score_offset = -100,
},
},
},
})

View file

@ -63,49 +63,7 @@
{ {
plugin = blink-cmp; plugin = blink-cmp;
type = "lua"; type = "lua";
config = '' config = lib.fileContents ./blink-cmp.lua;
require'blink-cmp'.setup({
keymap = {
preset = 'enter',
["<PageDown>"] = { "scroll_documentation_down" },
["<PageUp>"] = { "scroll_documentation_up" },
},
completion = {
accept = {
auto_brackets = { enabled = true, },
},
documentation = {
auto_show = true,
auto_show_delay_ms = 800,
window = { border = 'rounded', },
},
ghost_text = { enabled = true },
menu = {
auto_show = false,
},
},
fuzzy = {
prebuilt_binaries = {
download = false
},
},
signature = {
enabled = true,
window = { border = 'rounded', },
},
sources = {
default = { 'lsp', 'buffer', 'path', 'snippets' },
cmdline = {},
},
})
'';
} }
{ {

View file

@ -11,9 +11,9 @@
]; ];
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
ts-comments-nvim
nvim-ts-context-commentstring nvim-ts-context-commentstring
playground playground
ts-comments-nvim
{ {
plugin = nvim-treesitter-context; plugin = nvim-treesitter-context;