miovim/config/keys.nix
2025-07-09 10:30:15 +02:00

189 lines
3.3 KiB
Nix

{
keymaps = [
# chad tree
{
mode = "n";
action = "<cmd>CHADopen<cr>";
key = "<leader>e";
options = {
desc = "Open ChadTree";
};
}
# barbar.nvim
{
mode = "n";
action = "<cmd>BufferNext<cr>";
key = "<S-l>";
options = {
desc = "Next buffer";
};
}
{
mode = "n";
action = "<cmd>BufferPrevious<cr>";
key = "<S-h>";
options = {
desc = "Previous buffer";
};
}
/*
{
mode = "n";
action = "<cmd>BufferMovePrevious";
key = "<S-H><Ctrl>H";
options = {
desc = "Move buffer to left";
};
}
{
mode = "n";
action = "<cmd>BufferMoveNext";
key = "<S-L><Ctrl>L";
options = {
desc = "Move buffer to right";
};
}
*/
{
mode = "n";
action = "<cmd>BufferClose<cr>";
key = "<leader><tab>q";
options = {
desc = "Close buffer";
};
}
{
mode = "n";
action = "<cmd>BufferOrderByName<cr>";
key = "<leader><tab>sn";
options = {
desc = "Sort buffer tabs by name";
};
}
# grug.nvim
{
mode = "n";
action = "<cmd>GrugFar<cr>";
key = "<leader>cr";
}
# lazygit
{
mode = "n";
action = "<cmd>LazyGit<cr>";
key = "<leader>gg";
options = {
desc = "Open lazygit";
};
}
# nvim-dap
{
mode = "n";
action = {
__raw = "function() require('dap').continue() end";
};
key = "<Leader>dd";
options = {
desc = "Start debugging session";
};
}
{
mode = "n";
action = {
__raw = "function() require('dap').toggle_breakpoint() end";
};
key = "ds";
options = {
desc = "Set breakpoint";
};
}
# toggleterm.nvim
{
mode = "n";
action = "<cmd>ToggleTerm size=40 direction=vertical<cr>";
key = "<Leader>ft";
options = {
desc = "Toggle terminal";
};
}
# trouble.nvim
{
mode = "n";
action = "<cmd>Trouble diagnostics toggle<cr>";
key = "<Leader>xx";
options = {
desc = "Diagnostics (Trouble)";
};
}
{
mode = "n";
action = "<cmd>Trouble diagnostics toggle filter.buf=0<cr>";
key = "<Leader>xX";
options = {
desc = "Buffer Diagnostics (Trouble)";
};
}
# vertical split
{
mode = "n";
action = "<cmd>vsplit<cr>";
key = "<Leader>|";
options = {
desc = "Vertical Split";
};
}
# zen mode
{
mode = "n";
action = "<cmd>ZenMode<cr>";
key = "<Leader>uz";
options = {
desc = "Go Zen Mode!";
};
}
];
plugins.fzf-lua.keymaps = {
"<leader>/" = "live_grep";
"<leader><Space>" = "files";
"<leader>gf" = "git_files";
"<leader>," = "buffers";
};
lsp.keymaps = [
{
key = "gd";
lspBufAction = "definition";
}
{
key = "gD";
lspBufAction = "references";
}
{
key = "gt";
lspBufAction = "type_definition";
}
{
key = "gi";
lspBufAction = "implementation";
}
{
key = "K";
lspBufAction = "hover";
}
];
}