feat(nvim): add useful shortcuts from lazyvim

This commit is contained in:
Michael Thomas 2024-07-04 10:23:55 -04:00
parent 48e223e5f0
commit c1e881e49a

View File

@ -4,6 +4,111 @@
# TODO: Move general mappings to which-key
keymaps = [
# better up/down
{
mode = ["n" "x"];
key = "j";
action = "v:count == 0 ? 'gj' : 'j'";
options = {
desc = "Down";
expr = true;
silent = true;
};
}
{
mode = ["n" "x"];
key = "<Down>";
action = "v:count == 0 ? 'gj' : 'j'";
options = {
desc = "Down";
expr = true;
silent = true;
};
}
{
mode = ["n" "x"];
key = "k";
action = "v:count == 0 ? 'gk' : 'k'";
options = {
desc = "Up";
expr = true;
silent = true;
};
}
{
mode = ["n" "x"];
key = "<Up>";
action = "v:count == 0 ? 'gk' : 'k'";
options = {
desc = "Up";
expr = true;
silent = true;
};
}
# Move to window using the <ctrl> hjkl keys
{
mode = "n";
key = "<C-h>";
action = "<C-w>h";
options = {
desc = "Go to Left Window";
remap = true;
};
}
{
mode = "n";
key = "<C-j>";
action = "<C-w>j";
options = {
desc = "Go to Lower Window";
remap = true;
};
}
{
mode = "n";
key = "<C-k>";
action = "<C-w>k";
options = {
desc = "Go to Upper Window";
remap = true;
};
}
{
mode = "n";
key = "<C-l>";
action = "<C-w>l";
options = {
desc = "Go to Right Window";
remap = true;
};
}
# Resize window using <ctrl> arrow keys
{
mode = "n";
key = "<C-Up>";
action = "<cmd>resize +2<cr>";
options = {desc = "Increase Window Height";};
}
{
mode = "n";
key = "<C-Down>";
action = "<cmd>resize -2<cr>";
options = {desc = "Decrease Window Height";};
}
{
mode = "n";
key = "<C-Left>";
action = "<cmd>vertical resize -2<cr>";
options = {desc = "Decrease Window Width";};
}
{
mode = "n";
key = "<C-Right>";
action = "<cmd>vertical resize +2<cr>";
options = {desc = "Increase Window Width";};
}
# Disable arrow keys
{
mode = ["n" "i"];