Restructure kitty a bit to allow more settings to pass to linux
This commit is contained in:
parent
0e32361ae2
commit
d95d41088d
|
@ -16,56 +16,9 @@ with lib; {
|
||||||
keybindings = {
|
keybindings = {
|
||||||
# Backslash
|
# Backslash
|
||||||
"0x5d" = "send_text all \\u005c";
|
"0x5d" = "send_text all \\u005c";
|
||||||
|
};
|
||||||
"${cmd}+t" = "new_tab_with_cwd";
|
|
||||||
"${cmd}+shift+t" = "new_tab";
|
|
||||||
"${cmd}+shift+o" = "launch --cwd=current --location=vsplit";
|
|
||||||
"${cmd}+o" = "launch --cwd=current --location=hsplit";
|
|
||||||
"${cmd}+shift+r" = "layout_action rotate";
|
|
||||||
## Move the active window in the indicated direction
|
|
||||||
"${cmd}+shift+h" = "move_window left";
|
|
||||||
"${cmd}+shift+k" = "move_window up";
|
|
||||||
"${cmd}+shift+j" = "move_window down";
|
|
||||||
"${cmd}+shift+l" = "move_window right";
|
|
||||||
## Switch focus to the neighboring window in the indicated direction
|
|
||||||
"${cmd}+h" = "neighboring_window left";
|
|
||||||
"${cmd}+k" = "neighboring_window up";
|
|
||||||
"${cmd}+j" = "neighboring_window down ";
|
|
||||||
"${cmd}+l" = "neighboring_window right";
|
|
||||||
## Detach window to its own tab
|
|
||||||
"${cmd}+d" = "detach_window new-tab";
|
|
||||||
## Change layout to fullscreen (stack) and back
|
|
||||||
"${cmd}+f" = "toggle_layout stack";
|
|
||||||
## Clear screen
|
|
||||||
"${cmd}+backspace" = "clear_terminal to_cursor active";
|
|
||||||
"${cmd}+shift+backspace" = "clear_terminal reset active";
|
|
||||||
## Hints
|
|
||||||
"ctrl+shift+p>n" = "kitten hints --type=linenum --linenum-action=tab kak {path} +{line}";
|
|
||||||
}
|
|
||||||
# Tab bindings
|
|
||||||
// builtins.listToAttrs
|
|
||||||
(map
|
|
||||||
(x: attrsets.nameValuePair "${cmd}+${toString x}" "goto_tab ${toString x}")
|
|
||||||
(lists.range 1 9));
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
# Tab settings
|
|
||||||
tab_bar_edge = "top";
|
|
||||||
tab_bar_style = "powerline";
|
|
||||||
tab_powerline_style = "slanted";
|
|
||||||
tab_title_template = "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.lightgreen}{fmt.bold}[{index}]{fmt.nobold} {fmt.fg.tab}{title}";
|
|
||||||
active_tab_title_template = "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}";
|
|
||||||
tab_bar_background = "#555";
|
|
||||||
active_tab_font_style = "normal";
|
|
||||||
|
|
||||||
# Layouts
|
|
||||||
## Mouse focus
|
|
||||||
focus_follows_mouse = true;
|
|
||||||
## Layout options
|
|
||||||
# Layouts
|
|
||||||
enabled_layouts = "splits,stack";
|
|
||||||
inactive_text_alpha = "0.65";
|
|
||||||
|
|
||||||
# MacOS specific
|
# MacOS specific
|
||||||
macos_option_as_alt = "left";
|
macos_option_as_alt = "left";
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
in
|
in
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
imports = [ ./darwin.nix ./linux.nix ];
|
imports = [ ./darwin.nix ./linux.nix ./tabs.nix ];
|
||||||
|
|
||||||
options.nki.programs.kitty = {
|
options.nki.programs.kitty = {
|
||||||
enable = mkEnableOption "Enable kitty";
|
enable = mkEnableOption "Enable kitty";
|
||||||
|
@ -23,12 +23,23 @@ with lib;
|
||||||
default = 21;
|
default = 21;
|
||||||
};
|
};
|
||||||
|
|
||||||
background = mkOption
|
background = mkOption {
|
||||||
{
|
|
||||||
type = types.nullOr types.path;
|
type = types.nullOr types.path;
|
||||||
description = "Path to the background image. If not set, default to a 0.9 opacity";
|
description = "Path to the background image. If not set, default to a 0.9 opacity";
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cmd = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "The main control key";
|
||||||
|
default = if pkgs.stdenv.isDarwin then "cmd" else "ctrl";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableTabs = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Enable tabs";
|
||||||
|
default = pkgs.stdenc.isDarwin;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.programs.kitty = mkIf cfg.enable {
|
config.programs.kitty = mkIf cfg.enable {
|
||||||
|
@ -66,12 +77,21 @@ with lib;
|
||||||
|
|
||||||
# Allow remote control (for kakoune integration)
|
# Allow remote control (for kakoune integration)
|
||||||
allow_remote_control = true;
|
allow_remote_control = true;
|
||||||
|
|
||||||
|
# Mouse focus
|
||||||
|
focus_follows_mouse = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"ctrl+shift+equal" = "no_op"; # Not possible with a JIS keyboard
|
"${cfg.cmd}+shift+equal" = "no_op"; # Not possible with a JIS keyboard
|
||||||
"ctrl+shift+^" = "change_font_size all +2.0"; # ... so use ^ instead
|
"${cfg.cmd}+shift+^" = "change_font_size all +2.0"; # ... so use ^ instead
|
||||||
|
|
||||||
|
## Clear screen
|
||||||
|
"${cfg.cmd}+backspace" = "clear_terminal to_cursor active";
|
||||||
|
"${cfg.cmd}+shift+backspace" = "clear_terminal reset active";
|
||||||
|
## Hints
|
||||||
|
"${cfg.cmd}+shift+p>n" = "kitten hints --type=linenum --linenum-action=tab kak {path} +{line}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ with lib;
|
||||||
settings.shell = "${config.programs.fish.package}/bin/fish";
|
settings.shell = "${config.programs.fish.package}/bin/fish";
|
||||||
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
|
"0xa5" = "send_text all \\u005c";
|
||||||
"ctrl+shift+n" = "new_os_window_with_cwd";
|
"ctrl+shift+n" = "new_os_window_with_cwd";
|
||||||
"ctrl+shift+enter" = "new_window_with_cwd";
|
"ctrl+shift+enter" = "new_window_with_cwd";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.my-kitty;
|
cfg = config.nki.programs.kitty;
|
||||||
cmd = cfg.cmd;
|
cmd = cfg.cmd;
|
||||||
in
|
in
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
programs.kitty.keybindings = mkIf cfg.enableTabs {
|
programs.kitty = mkIf cfg.enableTabs {
|
||||||
|
keybindings = {
|
||||||
"${cmd}+t" = "new_tab_with_cwd";
|
"${cmd}+t" = "new_tab_with_cwd";
|
||||||
"${cmd}+shift+t" = "new_tab";
|
"${cmd}+shift+t" = "new_tab";
|
||||||
"${cmd}+shift+o" = "launch --cwd=current --location=vsplit";
|
"${cmd}+shift+o" = "launch --cwd=current --location=vsplit";
|
||||||
"${cmd}+o" = "launch --cwd=current --location=hsplit";
|
"${cmd}+o" = "launch --cwd=current --location=hsplit";
|
||||||
|
"${cmd}+r" = "start_resizing_window";
|
||||||
"${cmd}+shift+r" = "layout_action rotate";
|
"${cmd}+shift+r" = "layout_action rotate";
|
||||||
## Move the active window in the indicated direction
|
## Move the active window in the indicated direction
|
||||||
"${cmd}+shift+h" = "move_window left";
|
"${cmd}+shift+h" = "move_window left";
|
||||||
|
@ -23,8 +25,29 @@ with lib;
|
||||||
"${cmd}+j" = "neighboring_window down ";
|
"${cmd}+j" = "neighboring_window down ";
|
||||||
"${cmd}+l" = "neighboring_window right";
|
"${cmd}+l" = "neighboring_window right";
|
||||||
## Detach window to its own tab
|
## Detach window to its own tab
|
||||||
"${cmd}+d" = "detach_window new-tab";
|
"${cmd}+shift+d" = "detach_window new-tab";
|
||||||
## Change layout to fullscreen (stack) and back
|
## Change layout to fullscreen (stack) and back
|
||||||
"${cmd}+f" = "toggle_layout stack";
|
"${cmd}+f" = "toggle_layout stack";
|
||||||
|
}
|
||||||
|
# Tab bindings
|
||||||
|
// builtins.listToAttrs
|
||||||
|
(map
|
||||||
|
(x: attrsets.nameValuePair "${cmd}+${toString x}" "goto_tab ${toString x}")
|
||||||
|
(lists.range 1 9));
|
||||||
|
settings = {
|
||||||
|
# Tab settings
|
||||||
|
tab_bar_edge = "top";
|
||||||
|
tab_bar_style = "powerline";
|
||||||
|
tab_powerline_style = "slanted";
|
||||||
|
tab_title_template = "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.lightgreen}{fmt.bold}[{index}]{fmt.nobold} {fmt.fg.tab}{title}";
|
||||||
|
active_tab_title_template = "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}";
|
||||||
|
tab_bar_background = "#555";
|
||||||
|
active_tab_font_style = "normal";
|
||||||
|
|
||||||
|
## Layout options
|
||||||
|
# Layouts
|
||||||
|
enabled_layouts = "splits,stack";
|
||||||
|
inactive_text_alpha = "0.65";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue