2024-06-03 11:05:46 +01:00
|
|
|
{
|
|
|
|
programs.nixvim.keymaps = [
|
|
|
|
# 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>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
|
|
|
# Telescope Plugin
|
|
|
|
{
|
|
|
|
# find files
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<Leader>ff";
|
|
|
|
action = "<cmd>Telescope find_files<CR>";
|
2024-09-14 20:19:07 +01:00
|
|
|
options = {noremap = true;};
|
2024-06-03 11:05:46 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
# live grep
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<Leader>fg";
|
|
|
|
action = "<cmd>Telescope live_grep<CR>";
|
2024-09-14 20:19:07 +01:00
|
|
|
options = {noremap = true;};
|
2024-06-03 11:05:46 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
# buffers
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<Leader>fb";
|
|
|
|
action = "<cmd>Telescope buffers<CR>";
|
2024-09-14 20:19:07 +01:00
|
|
|
options = {noremap = true;};
|
2024-06-03 11:05:46 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
# help tags
|
2024-09-14 20:19:07 +01:00
|
|
|
mode = ["n"];
|
2024-06-03 11:05:46 +01:00
|
|
|
key = "<Leader>fh";
|
|
|
|
action = "<cmd>Telescope help_tags<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-06-03 11:05:46 +01:00
|
|
|
];
|
|
|
|
}
|