fix: set mode for all keymaps
This commit is contained in:
parent
53fdfbb8ba
commit
ec180d7365
13 changed files with 83 additions and 9 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L56-L89
|
||||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>c";
|
||||
options.desc = "Close buffer";
|
||||
|
||||
|
|
@ -12,6 +13,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>C";
|
||||
options.desc = "Force close buffer";
|
||||
|
||||
|
|
@ -22,6 +24,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "]b";
|
||||
options.desc = "Next buffer in tabline";
|
||||
|
||||
|
|
@ -32,6 +35,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "[b";
|
||||
options.desc = "Previous buffer in tabline";
|
||||
|
||||
|
|
@ -42,6 +46,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = ">b";
|
||||
options.desc = "Move buffer tab right";
|
||||
|
||||
|
|
@ -52,6 +57,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<b";
|
||||
options.desc = "Move buffer tab left";
|
||||
|
||||
|
|
@ -62,6 +68,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bc";
|
||||
options.desc = "Close all buffers except current";
|
||||
|
||||
|
|
@ -72,6 +79,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bC";
|
||||
options.desc = "Close all buffers";
|
||||
|
||||
|
|
@ -82,6 +90,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bl";
|
||||
options.desc = "Close all buffers to the left";
|
||||
|
||||
|
|
@ -92,6 +101,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
options.desc = "Previous buffer";
|
||||
|
||||
|
|
@ -102,6 +112,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>br";
|
||||
options.desc = "Close all buffers to the right";
|
||||
|
||||
|
|
@ -112,6 +123,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>bse";
|
||||
options.desc = "By extension";
|
||||
|
||||
|
|
@ -122,6 +134,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>bsr";
|
||||
options.desc = "By relative path";
|
||||
|
||||
|
|
@ -132,6 +145,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>bsp";
|
||||
options.desc = "By full path";
|
||||
|
||||
|
|
@ -142,6 +156,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>bsi";
|
||||
options.desc = "By buffer number";
|
||||
|
||||
|
|
@ -152,6 +167,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>bsm";
|
||||
options.desc = "By modification";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L92-L100
|
||||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ld";
|
||||
options.desc = "Hover diagnostics";
|
||||
|
||||
|
|
@ -12,6 +13,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "[d";
|
||||
options.desc = "Previous diagnostic";
|
||||
|
||||
|
|
@ -22,6 +24,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "]d";
|
||||
options.desc = "Next diagnostic";
|
||||
|
||||
|
|
@ -32,6 +35,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gl";
|
||||
options.desc = "Hover diagnostics";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,41 +2,49 @@
|
|||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L107-L114
|
||||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-H>";
|
||||
action = "<C-w>h";
|
||||
options.desc = "Move to left split";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-J>";
|
||||
action = "<C-w>j";
|
||||
options.desc = "Move to below split";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-K>";
|
||||
action = "<C-w>k";
|
||||
options.desc = "Move to above split";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-L>";
|
||||
action = "<C-w>l";
|
||||
options.desc = "Move to right split";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-Up>";
|
||||
action = "<Cmd>resize -2<CR>";
|
||||
options.desc = "Resize split up";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-Down>";
|
||||
action = "<Cmd>resize +2<CR>";
|
||||
options.desc = "Resize split down";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-Left>";
|
||||
action = "<Cmd>vertical resize -2<CR>";
|
||||
options.desc = "Resize split left";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-Right>";
|
||||
action = "<Cmd>vertical resize +2<CR>";
|
||||
options.desc = "Resize split right";
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ in
|
|||
# Standard operations
|
||||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L27-L44
|
||||
{
|
||||
key = "j";
|
||||
mode = [ "n" "x" ];
|
||||
key = "j";
|
||||
action = "v:count == 0 ? 'gj' : 'j'";
|
||||
|
||||
options = {
|
||||
|
|
@ -19,8 +19,8 @@ in
|
|||
};
|
||||
}
|
||||
{
|
||||
key = "k";
|
||||
mode = [ "n" "x" ];
|
||||
key = "k";
|
||||
action = "v:count == 0 ? 'gk' : 'k'";
|
||||
|
||||
options = {
|
||||
|
|
@ -30,51 +30,60 @@ in
|
|||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>w";
|
||||
action = "<cmd>w<cr>";
|
||||
options.desc = "Save";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>q";
|
||||
action = "<cmd>confirm q<cr>";
|
||||
options.desc = "Quit window";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>Q";
|
||||
action = "<cmd>confirm qall<cr>";
|
||||
options.desc = "Exit neovim";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>n";
|
||||
action = "<cmd>enew<cr>";
|
||||
options.desc = "New file";
|
||||
}
|
||||
{
|
||||
inherit (forceWrite) action options;
|
||||
mode = "n";
|
||||
key = "<c-s>";
|
||||
}
|
||||
{
|
||||
inherit (forceWrite) options;
|
||||
key = "<c-s>";
|
||||
mode = [ "i" "x" ];
|
||||
key = "<c-s>";
|
||||
action = "<esc>" + forceWrite.action;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<c-q>";
|
||||
action = "<cmd>q!<cr>";
|
||||
options.desc = "Force quit";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "|";
|
||||
action = "<cmd>vsplit<cr>";
|
||||
options.desc = "Vertical split";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "\\";
|
||||
action = "<cmd>split<cr>";
|
||||
options.desc = "Horizontal split";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gx";
|
||||
action.__raw = "require('astrocore').system_open";
|
||||
options.desc = "Open the file under cursor with system app";
|
||||
|
|
@ -83,14 +92,14 @@ in
|
|||
# Stay in indent mode
|
||||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L117-L118
|
||||
{
|
||||
mode = "v";
|
||||
key = "<S-Tab>";
|
||||
mode = [ "v" ];
|
||||
action = "<gv";
|
||||
options.desc = "Unindent line";
|
||||
}
|
||||
{
|
||||
mode = "v";
|
||||
key = "<Tab>";
|
||||
mode = [ "v" ];
|
||||
action = ">gv";
|
||||
options.desc = "Indent line";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L103-L104
|
||||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "]t";
|
||||
options.desc = "Next tab";
|
||||
|
||||
|
|
@ -12,6 +13,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "[t";
|
||||
options.desc = "Previous tab";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,26 +2,26 @@
|
|||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L121-L124
|
||||
[
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-H>";
|
||||
mode = [ "t" ];
|
||||
action = "<Cmd>wincmd h<CR>";
|
||||
options.desc = "Terminal left window navigation";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-J>";
|
||||
mode = [ "t" ];
|
||||
action = "<Cmd>wincmd j<CR>";
|
||||
options.desc = "Terminal down window navigation";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-K>";
|
||||
mode = [ "t" ];
|
||||
action = "<Cmd>wincmd k<CR>";
|
||||
options.desc = "Terminal up window navigation";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-L>";
|
||||
mode = [ "t" ];
|
||||
action = "<Cmd>wincmd l<CR>";
|
||||
options.desc = "Terminal right window navigation";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L128-L145
|
||||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>uA";
|
||||
options.desc = "Toggle rooter autochdir";
|
||||
|
||||
|
|
@ -12,6 +13,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ub";
|
||||
options.desc = "Toggle background";
|
||||
|
||||
|
|
@ -22,6 +24,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ud";
|
||||
options.desc = "Toggle diagnostics";
|
||||
|
||||
|
|
@ -32,6 +35,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ug";
|
||||
options.desc = "Toggle signcolumn";
|
||||
|
||||
|
|
@ -42,6 +46,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>u>";
|
||||
options.desc = "Toggle foldcolumn";
|
||||
|
||||
|
|
@ -52,6 +57,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ui";
|
||||
options.desc = "Change indent setting";
|
||||
|
||||
|
|
@ -62,6 +68,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ul";
|
||||
options.desc = "Toggle statusline";
|
||||
|
||||
|
|
@ -72,6 +79,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>un";
|
||||
options.desc = "Change line numbering";
|
||||
|
||||
|
|
@ -82,6 +90,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>uN";
|
||||
options.desc = "Toggle Notifications";
|
||||
|
||||
|
|
@ -92,6 +101,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>up";
|
||||
options.desc = "Toggle paste mode";
|
||||
|
||||
|
|
@ -102,6 +112,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>us";
|
||||
options.desc = "Toggle spellcheck";
|
||||
|
||||
|
|
@ -112,6 +123,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>uS";
|
||||
options.desc = "Toggle conceal";
|
||||
|
||||
|
|
@ -122,6 +134,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>ut";
|
||||
options.desc = "Toggle tabline";
|
||||
|
||||
|
|
@ -132,6 +145,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>uu";
|
||||
options.desc = "Toggle URL highlight";
|
||||
|
||||
|
|
@ -142,6 +156,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>uw";
|
||||
options.desc = "Toggle wrap";
|
||||
|
||||
|
|
@ -152,6 +167,7 @@
|
|||
'';
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Leader>uy";
|
||||
options.desc = "Toggle syntax highlight";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue