nix-config/home/features/coding/nixvim/keymaps.nix

118 lines
2.1 KiB
Nix

{
programs.nixvim.keymaps = [
{
mode = [
"n"
"v"
];
key = "<leader>fc";
action = "<cmd>lua vim.lsp.buf.format()<cr>";
options = {
silent = true;
desc = "Format Code";
};
}
{
mode = "n";
key = "<leader>ch";
action = "<cmd>noh<CR>";
options = {
silent = true;
desc = "Clear Highlighting";
};
}
{
mode = "n";
key = "<C-p>";
action = "<cmd>Telescope live_grep<CR>";
options = {
desc = "Telescope LiveGrep";
};
}
{
mode = "n";
key = "<leader>fg";
action = "<cmd>Telescope find_files<CR>";
options = {
desc = "Telescope File Search";
};
}
{
mode = "n";
key = "<C-n>";
action = "<Cmd>Neotree toggle<CR>";
options = {
silent = true;
desc = "Toggle Neotree";
};
}
{
mode = "n";
key = "<leader><tab><tab>";
action = "<cmd>tabnew<cr>";
options = {
desc = "New Tab";
};
}
{
mode = "n";
key = "<leader><tab>]";
action = "<cmd>BufferNext<cr>";
options = {
desc = "Next Tab";
};
}
{
mode = "n";
key = "<leader><tab>d";
action = "<cmd>BufferClose<cr>";
options = {
desc = "Close Tab";
};
}
{
mode = "n";
key = "<leader><tab>[";
action = "<cmd>BufferPrevious<cr>";
options = {
desc = "Previous Tab";
};
}
{
mode = "n";
key = "<c-k>";
action = ":wincmd k<CR>";
options = {
silent = true;
desc = "Go Up";
};
}
{
mode = "n";
key = "<c-j>";
action = ":wincmd j<CR>";
options = {
silent = true;
desc = "Go Down";
};
}
{
mode = "n";
key = "<c-h>";
action = ":wincmd h<CR>";
options = {
silent = true;
desc = "Go Left";
};
}
{
mode = "n";
key = "<c-l>";
action = ":wincmd l<CR>";
options = {
silent = true;
desc = "Go Right";
};
}
];
}