Restructure keybindings for improved discoverability and consistency with WezTerm/XMonad configurations. Separate keymaps from plugin configurations following single responsibility principle. Changes: - Create keymaps/ directory with semantic grouping: - general.nix: leader setup, page navigation - buffers.nix: buffer operations (bq, bQ, bl) - windows.nix: window operations (ws, wv, wq, wQ, wm) - find.nix: telescope find operations (ff, fg, fh, fc) - git.nix: unified git operations from gitsigns/fugitive/telescope - Adopt consistent q/Q pattern across containers: - bq/bQ for buffer quit (current/all others) - wq/wQ for window quit (current/all others) - Mirrors WezTerm's LEADER+p q / LEADER+t q pattern - Extract keymaps from plugin files: - telescope.nix: config only, keymaps moved to find.nix - fugitive.nix: config only, keymaps moved to git.nix - gitsigns.nix: config only, keymaps moved to git.nix - snacks.nix: config only, keymaps moved to buffers.nix - maximize.nix: config only, keymap moved to windows.nix - Remove smart-splits.nix (functionality replaced by native window ops) - Maintain navigation on dedicated modifiers (Ctrl+arrows/PageUp/PageDown) for consistency with WezTerm (ALT) and XMonad (Super)
70 lines
1.3 KiB
Nix
70 lines
1.3 KiB
Nix
{...}: {
|
|
keymaps = [
|
|
# Buffer namespace indicator for whichkey
|
|
{
|
|
mode = ["n"];
|
|
key = "<leader>b";
|
|
action = "<NOP>";
|
|
options = {
|
|
desc = "+buffer";
|
|
};
|
|
}
|
|
|
|
# Buffer deletion
|
|
{
|
|
mode = ["n"];
|
|
key = "<leader>bq";
|
|
action = {
|
|
__raw = "function() require('snacks').bufdelete() end";
|
|
};
|
|
options = {
|
|
desc = "Quit current buffer";
|
|
silent = true;
|
|
};
|
|
}
|
|
|
|
{
|
|
mode = ["n"];
|
|
key = "<leader>bQ";
|
|
action = {
|
|
__raw = "function() require('snacks').bufdelete.other() end";
|
|
};
|
|
options = {
|
|
desc = "Quit all other buffers";
|
|
silent = true;
|
|
};
|
|
}
|
|
|
|
# Buffer navigation (moved from keymaps.nix)
|
|
{
|
|
mode = ["n"];
|
|
key = "<C-Left>";
|
|
action = ":bprevious<CR>";
|
|
options = {
|
|
desc = "Previous buffer";
|
|
silent = true;
|
|
};
|
|
}
|
|
|
|
{
|
|
mode = ["n"];
|
|
key = "<C-Right>";
|
|
action = ":bnext<CR>";
|
|
options = {
|
|
desc = "Next buffer";
|
|
silent = true;
|
|
};
|
|
}
|
|
|
|
# Buffer listing
|
|
{
|
|
mode = ["n"];
|
|
key = "<leader>bl";
|
|
action = "<cmd>Telescope buffers<CR>";
|
|
options = {
|
|
desc = "List buffers";
|
|
silent = true;
|
|
};
|
|
}
|
|
];
|
|
}
|