2024-06-03 11:05:46 +01:00
|
|
|
{
|
2024-11-12 16:09:09 +00:00
|
|
|
programs.nixvim.keymaps = [
|
2024-06-03 11:05:46 +01:00
|
|
|
# Switching buffers
|
|
|
|
{
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
|
|
|
action = "<C-w>h";
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<S-h>";
|
2024-11-12 16:09:09 +00:00
|
|
|
options = {silent = true;};
|
2024-06-03 11:05:46 +01:00
|
|
|
}
|
|
|
|
{
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
|
|
|
action = "<C-w>j";
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<S-j>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
|
|
|
action = "<C-w>k";
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<S-k>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
|
|
|
action = "<C-w>l";
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<S-l>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
# Toggle nvim-tree
|
|
|
|
{
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
2024-06-03 11:05:46 +01:00
|
|
|
action = "<cmd>NvimTreeFindFileToggle<CR>";
|
|
|
|
key = "tt";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
# Clear search highlighting
|
|
|
|
{
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<space><space>";
|
|
|
|
action = "<cmd>nohlsearch<CR>";
|
2024-09-14 20:19:07 +01:00
|
|
|
options = {noremap = true;};
|
2024-06-03 11:05:46 +01:00
|
|
|
}
|
|
|
|
|
2024-09-15 09:51:21 +01:00
|
|
|
# paste over selected text without yanking it
|
|
|
|
{
|
|
|
|
mode = ["v"];
|
|
|
|
key = "p";
|
|
|
|
action = "\"_dP";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
# resize window
|
|
|
|
{
|
|
|
|
mode = ["n"];
|
|
|
|
key = "<Right>";
|
|
|
|
action = ":vertical resize +1<CR>";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mode = ["n"];
|
|
|
|
key = "<Left>";
|
|
|
|
action = ":vertical resize -1<CR>";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mode = ["n"];
|
|
|
|
key = "<Down>";
|
|
|
|
action = ":resize -1<CR>";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mode = ["n"];
|
|
|
|
key = "<Up>";
|
|
|
|
action = ": resize +1<CR>";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
2024-11-12 16:09:09 +00:00
|
|
|
|
|
|
|
# indent line in or out
|
|
|
|
{
|
|
|
|
mode = ["v"];
|
|
|
|
key = "<";
|
|
|
|
action = "<gv";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mode = ["v"];
|
|
|
|
key = ">";
|
|
|
|
action = ">gv";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
|
|
|
|
# move selected line up or down
|
|
|
|
{
|
|
|
|
mode = ["v"];
|
2024-11-24 21:10:41 +00:00
|
|
|
key = "<C-d>";
|
2024-11-12 16:09:09 +00:00
|
|
|
action = ":m '>+1<CR>gv=gv";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
mode = ["v"];
|
2024-11-24 21:10:41 +00:00
|
|
|
key = "<C-u>";
|
2024-11-12 16:09:09 +00:00
|
|
|
action = ":m '<-2<CR>gv=gv";
|
|
|
|
options = {noremap = true;};
|
|
|
|
}
|
2024-06-03 11:05:46 +01:00
|
|
|
];
|
|
|
|
}
|