Skip to content

Commit

Permalink
Merge pull request #100 from mcgilly17/main
Browse files Browse the repository at this point in the history
Feat: move general mappings to which-key v3
  • Loading branch information
redyf authored Aug 20, 2024
2 parents 896f0f6 + 75561f6 commit 14efbe9
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 129 deletions.
22 changes: 13 additions & 9 deletions config/bufferlines/bufferline.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
plugins = {
bufferline = {
enable = true;
separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin”
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
];
settings = {
options = {
separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin“
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
];
};
};
};
};
keymaps = [
Expand Down
62 changes: 0 additions & 62 deletions config/keymaps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,68 +45,6 @@
desc = "Disable Left arrow key";
};
}

# General maps
{
mode = "n";
key = "<leader>f";
action = "+find/file";
}

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

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

{
mode = ["n" "v"];
key = "<leader>g";
action = "+git";
}

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

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

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

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

{
mode = ["n" "v"];
key = "<leader>c";
action = "+code";
}

{
mode = ["n" "v"];
key = "<leader>t";
action = "+test";
}

# Tabs
{
mode = "n";
Expand Down
2 changes: 1 addition & 1 deletion config/sets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
colorcolumn = "80";

# Reduce which-key timeout to 10ms
timeoutlen = 10;
timeoutlen = 100;

# Set encoding type
encoding = "utf-8";
Expand Down
8 changes: 2 additions & 6 deletions config/snippets/luasnip.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
pkgs,
config,
...
}: {
{pkgs, ...}: {
plugins.luasnip = {
enable = true;
extraConfig = {
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
Expand Down
124 changes: 111 additions & 13 deletions config/utils/whichkey.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,117 @@
{
# TODO: Implement general mappings
plugins.which-key = {
enable = true;
ignoreMissing = false;
icons = {
breadcrumb = "»";
group = "+";
separator = ""; # ➜
};
# registrations = {
# "<leader>t" = " Terminal";
# };
window = {
border = "none";
winblend = 0;
settings = {
icons = {
breadcrumb = "»";
group = "+";
separator = ""; # ➜
};
spec = [
# Harpoon Configs
{
__unkeyed-1 = "<leader>h";
mode = "n";
group = "+harpoon";
icon = "󱡁";
}
{
__unkeyed-1 = "<leader>ha";
mode = "n";
group = "Add file to Harpoon";
}
{
__unkeyed-1 = "<leader>hj";
mode = "n";
group = "Harpoon File 1";
}
{
__unkeyed-1 = "<leader>hk";
mode = "n";
group = "Harpoon File 2";
}
{
__unkeyed-1 = "<leader>hl";
mode = "n";
group = "Harpoon File 3";
}
{
__unkeyed-1 = "<leader>hm";
mode = "n";
group = "Harpoon File 4";
}

# General Mappings
{
__unkeyed-1 = "<leader>c";
mode = [
"n"
"v"
];
group = "+code";
}
{
__unkeyed-1 = "<leader>d";
mode = [
"n"
"v"
];
group = "+debug";
}
{
__unkeyed-1 = "<leader>f";
mode = "n";
group = "+find/file";
}

{
__unkeyed-1 = "<leader>g";
mode = [
"n"
"v"
];
group = "+git";
}

{
__unkeyed-1 = "<leader>q";
mode = "n";
group = "+quit/session";
}

{
__unkeyed-1 = "<leader>s";
mode = "n";
group = "+search";
}
{
__unkeyed-1 = "<leader><Tab>";
mode = "n";
group = "+tab";
}

{
__unkeyed-1 = "<leader>t";
mode = "n";
group = "+test";
}

{
__unkeyed-1 = "<leader>u";
mode = "n";
group = "+ui";
}

{
__unkeyed-1 = "<leader>w";
mode = "n";
group = "+windows";
}
];
win = {
border = "none";
wo.winblend = 0;
};
};
};
}
Loading

0 comments on commit 14efbe9

Please sign in to comment.