Skip to content

Commit

Permalink
[neovim] Add which-key plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Aug 21, 2024
1 parent cc16b23 commit c2c91ae
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
19 changes: 18 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
tmux-dark-notify.flake = false;
tmux-dark-notify.url = "github:erikw/tmux-dark-notify";
which-key-nvim.url = "github:folke/which-key.nvim";
which-key-nvim.flake = false;
};

outputs = inputs: {
Expand Down Expand Up @@ -41,6 +43,10 @@
name = "auto-dark-mode.nvim";
src = inputs.auto-dark-mode-nvim;
};
which-key-nvim = prev.vimUtils.buildVimPlugin {
name = "which-key.nvim";
src = inputs.which-key-nvim;
};
};
nixd = inputs.nixd.packages.${system}.default;
})
Expand Down
1 change: 1 addition & 0 deletions home/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
./plugins/solarized
./plugins/telescope
./plugins/treesitter
./plugins/which-key
./plugins/whitespace
];
viAlias = true;
Expand Down
14 changes: 14 additions & 0 deletions home/neovim/plugins/which-key/config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local wk = require("which-key")

wk.setup()

-- Document existing key chains
wk.add({
{ "<leader>c", group = "[C]ode" },
{ "<leader>d", group = "[D]ocument" },
{ "<leader>r", group = "[R]ename" },
{ "<leader>s", group = "[S]earch" },
{ "<leader>w", group = "[W]orkspace" },
{ "<leader>t", group = "[T]oggle" },
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
})
9 changes: 9 additions & 0 deletions home/neovim/plugins/which-key/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs, ... }:

[
{
plugin = pkgs.vimPlugins.which-key-nvim;
config = builtins.readFile ./config.lua;
type = "lua";
}
]

0 comments on commit c2c91ae

Please sign in to comment.