big refactor
This commit is contained in:
commit
76d68230f6
81 changed files with 3065 additions and 0 deletions
26
modules/programs/nixvim/keymaps/_default.nix
Normal file
26
modules/programs/nixvim/keymaps/_default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
[
|
||||
{
|
||||
mode = "i";
|
||||
key = "<A-h>";
|
||||
action = "<Left>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = "<A-j>";
|
||||
action = "<Down>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = "<A-k>";
|
||||
action = "<Up>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = "<A-l>";
|
||||
action = "<Right>";
|
||||
options.silent = true;
|
||||
}
|
||||
]
|
||||
11
modules/programs/nixvim/keymaps/_keymaps.nix
Normal file
11
modules/programs/nixvim/keymaps/_keymaps.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
{
|
||||
globals.mapleader = " ";
|
||||
keymaps =
|
||||
[ ]
|
||||
++ (import ./_default.nix)
|
||||
++ (import ./barbar.nix)
|
||||
++ (import ./toggleterm.nix)
|
||||
++ (import ./nvim-tree-toggle.nix);
|
||||
}
|
||||
|
||||
39
modules/programs/nixvim/keymaps/barbar.nix
Normal file
39
modules/programs/nixvim/keymaps/barbar.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<A-,>";
|
||||
action = "<cmd>BufferPrevious<CR>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<A-.>";
|
||||
action = "<cmd>BufferNext<CR>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<A-<>";
|
||||
action = "<cmd>BufferMovePrevious<CR>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<A->>";
|
||||
action = "<cmd>BufferMoveNext<CR>";
|
||||
options.silent = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<A-c>";
|
||||
action = "<Cmd>BufferClose<CR>";
|
||||
options.silent = true;
|
||||
}
|
||||
]
|
||||
++ (builtins.genList (i: {
|
||||
mode = "n";
|
||||
key = "<A-${toString (i + 1)}>";
|
||||
action = "<cmd>BufferGoto ${toString (i + 1)}<CR>";
|
||||
options.silent = true;
|
||||
}) 9)
|
||||
|
||||
8
modules/programs/nixvim/keymaps/nvim-tree-toggle.nix
Normal file
8
modules/programs/nixvim/keymaps/nvim-tree-toggle.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-b>";
|
||||
action = "<cmd>NvimTreeToggle<CR>";
|
||||
options.silent = true;
|
||||
}
|
||||
]
|
||||
63
modules/programs/nixvim/keymaps/toggleterm.nix
Normal file
63
modules/programs/nixvim/keymaps/toggleterm.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
[
|
||||
{
|
||||
mode = "t";
|
||||
key = "<esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "jk";
|
||||
action = "<C-\\><C-n>";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-w>";
|
||||
action = "<C-\\><C-n><C-w>";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-l>";
|
||||
action = "<Cmd>wincmd l<CR>";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-k>";
|
||||
action = "<Cmd>wincmd k<CR>";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-j>";
|
||||
action = "<Cmd>wincmd j<CR>";
|
||||
}
|
||||
{
|
||||
mode = "t";
|
||||
key = "<C-h>";
|
||||
action = "<Cmd>wincmd h<CR>";
|
||||
}
|
||||
]
|
||||
++ builtins.concatLists (
|
||||
builtins.genList (i: [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>th${toString (i + 1)}";
|
||||
action = ":${toString (i + 1)}ToggleTerm direction=horizontal<CR>";
|
||||
options.silent = true;
|
||||
options.noremap = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tv${toString (i + 1)}";
|
||||
action = ":${toString (i + 1)}ToggleTerm direction=vertical<CR>";
|
||||
options.silent = true;
|
||||
options.noremap = true;
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tf${toString (i + 1)}";
|
||||
action = ":${toString (i + 1)}ToggleTerm direction=float<CR>";
|
||||
options.silent = true;
|
||||
options.noremap = true;
|
||||
}
|
||||
]) 9
|
||||
)
|
||||
Reference in a new issue