initial commit
This commit is contained in:
commit
35fb1473db
20 changed files with 836 additions and 0 deletions
96
config/keybindings.nix
Normal file
96
config/keybindings.nix
Normal file
|
@ -0,0 +1,96 @@
|
|||
{ helpers, ... }:
|
||||
{
|
||||
keymaps = [
|
||||
# Window movement.
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<c-h>";
|
||||
action = "<c-w>h";
|
||||
options = {
|
||||
remap = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<c-h>";
|
||||
action = helpers.mkRaw ''
|
||||
function()
|
||||
local cur_win = vim.api.nvim_get_current_win()
|
||||
vim.cmd('wincmd h')
|
||||
if cur_win == vim.api.nvim_get_current_win() then
|
||||
require('neo-tree.command').execute({ toggle = true })
|
||||
end
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
remap = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<c-j>";
|
||||
action = helpers.mkRaw ''
|
||||
function()
|
||||
local cur_win = vim.api.nvim_get_current_win()
|
||||
vim.cmd('wincmd j')
|
||||
if cur_win == vim.api.nvim_get_current_win() then
|
||||
vim.cmd('ToggleTerm')
|
||||
end
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
remap = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<c-k>";
|
||||
action = "<c-w>k";
|
||||
options = {
|
||||
remap = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<c-l>";
|
||||
action = "<c-w>l";
|
||||
options = {
|
||||
remap = true;
|
||||
};
|
||||
}
|
||||
|
||||
# Use ESC to exit terminal mode
|
||||
{
|
||||
mode = [ "t" ];
|
||||
key = "<Esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
}
|
||||
|
||||
# Buffer movement
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<s-h>";
|
||||
action = "<cmd>bprevious<cr>";
|
||||
options = {
|
||||
desc = "Previous Buffer";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<s-l>";
|
||||
action = "<cmd>bnext<cr>";
|
||||
options = {
|
||||
desc = "Next Buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = [ "n" "i" ];
|
||||
key = "<S-Tab>";
|
||||
action = "<cmd>tabprevious<cr>";
|
||||
options = {
|
||||
desc = "Previous Tab";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue