nixvim-config/config/keymaps.nix

88 lines
1.4 KiB
Nix

{...}: {
globals.mapleader = " ";
keymaps = [
{
mode = ["n"];
key = "<ESC>";
action = ":noh<CR>";
options = {
silent = true;
};
}
{ # focus window left
mode = ["n"];
key = "<C-Left>";
action = "<C-w>h";
options = {
silent = true;
};
}
{ # focus window down
mode = ["n"];
key = "<C-Down>";
action = "<C-w>j";
options = {
silent = true;
};
}
{ # focus window up
mode = ["n"];
key = "<C-Up>";
action = "<C-w>k";
options = {
silent = true;
};
}
{ # focus window right
mode = ["n"];
key = "<C-Right>";
action = "<C-w>l";
options = {
silent = true;
};
}
{ # buffer prefix
mode = "n";
key = "<leader>b";
action = "<Nop>";
options = {
desc = "+buffer";
};
}
{ # goto next buffer
mode = ["n"];
key = "<leader>bn";
action = ":bnext<cr>";
options = {
silent = true;
};
}
{ # goto previous buffer
mode = ["n"];
key = "<leader>bp";
action = ":bprevious<cr>";
options = {
silent = true;
};
}
{ # delete buffer
mode = ["n"];
key = "<leader>bd";
action = ":b#<bar>bd#<cr>";
options = {
desc = ":bdelete";
silent = true;
};
}
];
}