flake/nixos/nvim/keymaps.nix
2025-02-04 08:28:09 -06:00

115 lines
2.2 KiB
Nix

{
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = [
{
mode = "n"; # Normal mode
key = "<Space>";
action = "<Nop>";
options.silent = true;
}
{
mode = "n";
key = "<A-Left>";
action = "<C-w>h";
options = {
desc = "Move Left";
silent = true;
};
}
{
mode = "n";
key = "<A-Down>";
action = "<C-w>j";
options = {
desc = "Move Down";
silent = true;
};
}
{
mode = "n";
key = "<A-Up>";
action = "<C-w>k";
options = {
desc = "Move Up";
silent = true;
};
}
{
mode = "n";
key = "<A-Right>";
action = "<C-w>l";
options = {
desc = "Move Right";
silent = true;
};
}
{
mode = "n";
key = "<Tab>";
action = ":bnext<CR>";
options = {
desc = "Next Buffer";
silent = true;
};
}
{
mode = "n";
key = "<S-Tab>";
action = ":bprevious<CR>";
options = {
desc = "Previous Buffer";
silent = true;
};
}
{
mode = "n";
key = "<leader>w";
action = ":w<CR>";
options = {
desc = "Save Buffer to File";
silent = false;
};
}
{
mode = "n";
key = "<leader>q";
action = ":bd<CR>";
options = {
desc = "Close Buffer";
silent = false;
};
}
{
mode = "n";
key = "<leader>Q";
action = ":bd!<CR>";
options = {
desc = "Force Close Buffer";
silent = false;
};
}
{
mode = "n";
key = "<leader>`";
action = ":qa<CR>";
options = {
desc = "Quit All";
silent = false;
};
}
{
mode = "t";
key = "<C-Esc>";
action = "<C-\\><C-n>";
options = {
desc = "Exit Terminal Mode"; # why does Neovim not have this by default??? wtf???
silent = true;
};
}
];
};
}