nixos-combined-flake/modules/nixvim/keymaps.nix

76 lines
1.2 KiB
Nix

_: {
keymaps = [
{
key = "<leader>e";
action = "<cmd>Neotree toggle<CR>";
options = {
silent = true;
};
}
{
key = "<leader>ff";
action = "<cmd>Telescope find_files<CR>";
options = {
silent = true;
};
}
{
key = "<Space>";
action = "<Nop>";
options = {
silent = true;
};
mode = ["n" "v"];
}
{
key = "<Esc>";
action = "<C-\\><C-n>";
options = {
silent = true;
};
mode = ["t"];
}
{
key = "q:";
action = "<Nop>";
options = {
noremap = true;
};
}
{
key = "k";
action = "v:count == 0 ? 'gk' : 'k'";
options = {
silent = true;
expr = true;
};
}
{
key = "j";
action = "v:count == 0 ? 'gj' : 'j'";
options = {
silent = true;
expr = true;
};
}
{
key = "<M-K>";
action = ":m -2<CR>";
}
{
key = "<M-J>";
action = ":m +1<CR>";
}
{
key = "<M-K>";
action = ":m '<-2<CR>gv=gv";
mode = ["v"];
}
{
key = "<M-J>";
action = ":m '>+1<CR>gv=gv";
mode = ["v"];
}
];
}