From b650a618ad55275e36af9a24c0c2a15f48d6e472 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Wed, 31 Jul 2024 10:26:59 -0500 Subject: [PATCH] nixvim fixed which-key. --- flake.lock | 65 +++++++++++------------ modules/home-manager/nvim/gitsigns.nix | 9 ++-- modules/home-manager/nvim/keybinds.nix | 9 ++-- modules/home-manager/nvim/lsp/default.nix | 9 ++-- modules/home-manager/nvim/telescope.nix | 14 +++-- modules/home-manager/nvim/which-key.nix | 13 +---- 6 files changed, 59 insertions(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index 15deeaf..89b02b3 100644 --- a/flake.lock +++ b/flake.lock @@ -28,22 +28,17 @@ }, "devshell": { "inputs": { - "flake-utils": [ - "nixvim", - "nuschtosSearch", - "flake-utils" - ], "nixpkgs": [ "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1721902368, - "narHash": "sha256-noQ5SghRPe0jzQEbFQb3fYbV6LZEzr7lIRQoxlU7fyI=", + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", "owner": "numtide", "repo": "devshell", - "rev": "cf8c7405479cfde7ea4dc815e195391d2328df10", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "type": "github" }, "original": { @@ -59,11 +54,11 @@ ] }, "locked": { - "lastModified": 1722028105, - "narHash": "sha256-0ButnGQ1bCMIDblzC6NBSL71Wi6JmHGweI3scoV8CgM=", + "lastModified": 1722217815, + "narHash": "sha256-8r5AJ3n8WEDw3rsZLALSuFQ5kJyWOcssNZvPxYLr2yc=", "owner": "nix-community", "repo": "disko", - "rev": "5b01cea8b5753de9c2febd27203c530be14745ff", + "rev": "1e6f8a7b4634fc051cc9361959bf414fcf17e094", "type": "github" }, "original": { @@ -203,11 +198,11 @@ ] }, "locked": { - "lastModified": 1722067813, - "narHash": "sha256-nxpzoKXwn+8RsxpxwD86mtEscOMw64ZD/vGSNWzGMlA=", + "lastModified": 1722407237, + "narHash": "sha256-wcpVHUc2nBSSgOM7UJSpcRbyus4duREF31xlzHV5T+A=", "owner": "nix-community", "repo": "home-manager", - "rev": "975b83ca560d17db51a66cb2b0dc0e44213eab27", + "rev": "58cef3796271aaeabaed98884d4abaab5d9d162d", "type": "github" }, "original": { @@ -224,11 +219,11 @@ ] }, "locked": { - "lastModified": 1721719500, - "narHash": "sha256-nnkqjv4Y37Hydjh6HE9wW4kSkV5Q7q4iIXlL5lwUFOw=", + "lastModified": 1722082646, + "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "884f3fe6d9bf056ba0017c132c39c1f0d07d4fec", + "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", "type": "github" }, "original": { @@ -256,11 +251,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1722017959, - "narHash": "sha256-vkv3MtjRtJdqeWMLH874ngbC6/5wUYzsdw0pb96ZLRc=", + "lastModified": 1722332872, + "narHash": "sha256-2xLM4sc5QBfi0U/AANJAW21Bj4ZX479MHPMPkB+eKBU=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "0b4d40f95a68ef0a6785f6b938ac8c1383321dbf", + "rev": "14c333162ba53c02853add87a0000cbd7aa230c2", "type": "github" }, "original": { @@ -283,11 +278,11 @@ ] }, "locked": { - "lastModified": 1722012218, - "narHash": "sha256-Rnjo49C5/slnmcQW9c57IdiHJZ3YEFmUn3as/NIPD4E=", + "lastModified": 1722253092, + "narHash": "sha256-37vyqHPx57deHhwvi4jwyNQLYkhm/rlVTYKOG1iahsc=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "ac026940beb42f74c5666f6ed3989aca41eddeea", + "rev": "f373ad59ae5866f0f98216bd5c71526b373450d2", "type": "github" }, "original": { @@ -299,11 +294,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1721924956, - "narHash": "sha256-Sb1jlyRO+N8jBXEX9Pg9Z1Qb8Bw9QyOgLDNMEpmjZ2M=", + "lastModified": 1722185531, + "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5ad6a14c6bf098e98800b091668718c336effc95", + "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", "type": "github" }, "original": { @@ -348,11 +343,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1722016645, - "narHash": "sha256-YQA4oenJwjWVzX+we6Zzv08im5q2n7dVhJ12Nw8wQio=", + "lastModified": 1722431209, + "narHash": "sha256-qBxvnoQuzhCHTej5JMw1EpjavufRgpMNP9klpO7mbI4=", "owner": "nix-community", "repo": "nixvim", - "rev": "162ae6354bbf2af5c33b09aa90e9d8d11f14462e", + "rev": "8945b3b5e336a42972448e2f07ed5bc465a40c83", "type": "github" }, "original": { @@ -370,11 +365,11 @@ ] }, "locked": { - "lastModified": 1721548975, - "narHash": "sha256-agCbztdk1f7nCUz03R6xdbivuBRuqubP2RHW+MNuRTg=", + "lastModified": 1722144272, + "narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=", "owner": "NuschtOS", "repo": "search", - "rev": "551b031e2bc0bcc9584347a8da6312e57169661d", + "rev": "16565307c267ec219c2b5d3494ba66df08e7d403", "type": "github" }, "original": { @@ -406,11 +401,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1721688883, - "narHash": "sha256-9jsjsRKtJRqNSTXKj9zuDFRf2PGix30nMx9VKyPgD2U=", + "lastModified": 1722114803, + "narHash": "sha256-s6YhI8UHwQvO4cIFLwl1wZ1eS5Cuuw7ld2VzUchdFP0=", "owner": "mic92", "repo": "sops-nix", - "rev": "aff2f88277dabe695de4773682842c34a0b7fd54", + "rev": "eb34eb588132d653e4c4925d862f1e5a227cc2ab", "type": "github" }, "original": { diff --git a/modules/home-manager/nvim/gitsigns.nix b/modules/home-manager/nvim/gitsigns.nix index 9689164..69cecfe 100644 --- a/modules/home-manager/nvim/gitsigns.nix +++ b/modules/home-manager/nvim/gitsigns.nix @@ -9,9 +9,12 @@ plugins.gitsigns = { enable = true; }; - plugins.which-key.registrations = { - "g" = "+git"; - }; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "g"; + group = "+git"; + } + ]; keymaps = [ { action = ":Gitsigns toggle_current_line_blame"; diff --git a/modules/home-manager/nvim/keybinds.nix b/modules/home-manager/nvim/keybinds.nix index 4d0b714..9d1c510 100644 --- a/modules/home-manager/nvim/keybinds.nix +++ b/modules/home-manager/nvim/keybinds.nix @@ -9,9 +9,12 @@ globals = { mapleader = ";"; }; - plugins.which-key.registrations = { - "c" = "+check"; - }; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "c"; + group = "+check"; + } + ]; keymaps = [ { action = ":setlocal spell!"; diff --git a/modules/home-manager/nvim/lsp/default.nix b/modules/home-manager/nvim/lsp/default.nix index ebbf439..ae9bd84 100644 --- a/modules/home-manager/nvim/lsp/default.nix +++ b/modules/home-manager/nvim/lsp/default.nix @@ -34,9 +34,12 @@ plugins.cmp.settings.sources = [ {name = "nvim_lsp";} ]; - plugins.which-key.registrations = { - "l" = "+lsp"; - }; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "l"; + group = "+lsp"; + } + ]; keymaps = [ { action = helpers.mkRaw "vim.lsp.buf.declaration"; diff --git a/modules/home-manager/nvim/telescope.nix b/modules/home-manager/nvim/telescope.nix index 887654d..1e39d62 100644 --- a/modules/home-manager/nvim/telescope.nix +++ b/modules/home-manager/nvim/telescope.nix @@ -9,10 +9,16 @@ plugins.telescope = { enable = true; }; - plugins.which-key.registrations = { - "f" = "+telescope"; - "fg" = "+telescope git"; - }; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "f"; + group = "+telescope"; + } + { + __unkeyed-1 = "fg"; + group = "+telescope git"; + } + ]; keymaps = [ { action = ":Telescope find_files"; diff --git a/modules/home-manager/nvim/which-key.nix b/modules/home-manager/nvim/which-key.nix index 3a1c056..b4e3986 100644 --- a/modules/home-manager/nvim/which-key.nix +++ b/modules/home-manager/nvim/which-key.nix @@ -10,18 +10,7 @@ timeout = true; timeoutlen = 300; }; - plugins.which-key = { - enable = true; - # TODO: remvoe this once https://github.com/nix-community/nixvim/issues/1901 is fixed. - package = pkgs.vimPlugins.which-key-nvim.overrideAttrs (oldAttrs: { - src = pkgs.fetchFromGitHub { - owner = oldAttrs.src.owner; - repo = oldAttrs.src.repo; - rev = "0539da005b98b02cf730c1d9da82b8e8edb1c2d2"; # v2.1.0 - hash = "sha256-gc/WJJ1s4s+hh8Mx8MTDg8pGGNOXxgKqBMwudJtpO4Y="; - }; - }); - }; + plugins.which-key.enable = true; }; }; }