Skip to content

Commit

Permalink
✨ (plug): which-key -> mini.clue
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Oct 2, 2024
1 parent 4192cf1 commit 5ff206f
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 11 deletions.
37 changes: 27 additions & 10 deletions config/keys.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,34 @@
mode = "n";
key = "<leader>/";
action = "<cmd>nohl<CR>";
options = {
desc = "Clear search";
};
}
{
mode = "n";
key = "<leader>f";
action = "+find/file";
options = {
desc = "+file/file";
};
}

{
mode = "n";
key = "<leader>s";
action = "+search";
options = {
desc = "+search";
};
}

{
mode = "n";
key = "<leader>q";
action = "+quit/session";
options = {
desc = "+quit/session";
};
}

{
Expand All @@ -33,33 +44,36 @@
];
key = "<leader>g";
action = "+git";
options = {
desc = "+git";
};
}

{
mode = "n";
key = "<leader>u";
action = "+ui";
options = {
desc = "+ui";
};
}

{
mode = "n";
key = "<leader>w";
action = "+windows";
options = {
desc = "+windows";
};
}

{
mode = "n";
key = "<leader><Tab>";
action = "+tab";
}

{
mode = [
"n"
"v"
];
key = "<leader>d";
action = "+debug";
options = {
desc = "+tab";
};
}

{
Expand All @@ -69,6 +83,9 @@
];
key = "<leader>c";
action = "+code";
options = {
desc = "+code";
};
}

# Tabs
Expand Down
121 changes: 121 additions & 0 deletions config/plug/utils/mini.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,103 @@
{ lib, config, ... }:
let
colors = import ../../colors/${config.theme}.nix { };
in
{
plugins.mini = {
enable = true;
mockDevIcons = true;
modules = {
ai = { };
align = { };
bracketed = { };
clue = {
window = {
delay = 500;
config = {
border = "none";
width.__raw = ''
math.floor(0.318 * vim.o.columns)
'';
row = "auto";
col = "auto";
anchor = "NE";
};
};
triggers = [
{
mode = "n";
keys = "<leader>";
}
{
mode = "x";
keys = "<leader>";
}
{
mode = "i";
keys = "<C-x>";
}
{
mode = "n";
keys = "g";
}
{
mode = "x";
keys = "g";
}
{
mode = "n";
keys = "'";
}
{
mode = "n";
keys = "`";
}
{
mode = "x";
keys = "'";
}
{
mode = "x";
keys = "`";
}
{
mode = "n";
keys = "\"";
}
{
mode = "x";
keys = "\"";
}
{
mode = "i";
keys = "<C-r>";
}
{
mode = "c";
keys = "<C-r>";
}
{
mode = "n";
keys = "<C-w>";
}
{
mode = "n";
keys = "z";
}
{
mode = "x";
keys = "z";
}
];
clues = [
{ __raw = "require('mini.clue').gen_clues.builtin_completion()"; }
{ __raw = "require('mini.clue').gen_clues.g()"; }
{ __raw = "require('mini.clue').gen_clues.marks()"; }
{ __raw = "require('mini.clue').gen_clues.registers()"; }
{ __raw = "require('mini.clue').gen_clues.windows()"; }
{ __raw = "require('mini.clue').gen_clues.z()"; }
];
};
files = {
content = {
filter.__raw = ''
Expand Down Expand Up @@ -70,4 +163,32 @@
};
}
];

highlight =
with colors;
lib.mkIf (config.plugins.mini.enable && lib.hasAttr "clue" config.plugins.mini.modules) {
MiniClueDescSingle = {
bg = base00;
};
MiniClueDescGroup = {
bg = base00;
fg = base0E;
};
MiniClueNextKey = {
bg = base00;
fg = base0D;
};
MiniClueNextKeyWithPostkeys = {
bg = base00;
fg = base0F;
};
MiniClueSeparator = {
bg = base00;
fg = base0E;
};
MiniClueBorder = {
bg = base00;
fg = base0E;
};
};
}
2 changes: 1 addition & 1 deletion config/plug/utils/whichkey.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
plugins.which-key = {
enable = true;
enable = false;
};
}

0 comments on commit 5ff206f

Please sign in to comment.