2022-06-10 17:41:53 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.nki.programs.kitty;
|
|
|
|
cmd = "cmd";
|
|
|
|
in
|
|
|
|
with lib; {
|
|
|
|
programs.kitty = mkIf (cfg.enable && pkgs.stdenv.isDarwin) {
|
|
|
|
|
|
|
|
# Darwin-specific setup
|
|
|
|
darwinLaunchOptions = [
|
|
|
|
"--single-instance"
|
|
|
|
"--start-as=fullscreen"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Tabs and layouts keybindings
|
|
|
|
keybindings = {
|
|
|
|
# Backslash
|
|
|
|
"0x5d" = "send_text all \\u005c";
|
|
|
|
|
2022-09-29 07:52:01 +00:00
|
|
|
"${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";
|
2022-06-10 17:41:53 +00:00
|
|
|
"${cmd}+shift+r" = "layout_action rotate";
|
|
|
|
## Move the active window in the indicated direction
|
|
|
|
"${cmd}+shift+h" = "move_window left";
|
2022-09-29 07:52:01 +00:00
|
|
|
"${cmd}+shift+k" = "move_window up";
|
|
|
|
"${cmd}+shift+j" = "move_window down";
|
2022-06-10 17:41:53 +00:00
|
|
|
"${cmd}+shift+l" = "move_window right";
|
|
|
|
## Switch focus to the neighboring window in the indicated direction
|
|
|
|
"${cmd}+h" = "neighboring_window left";
|
2022-09-29 07:52:01 +00:00
|
|
|
"${cmd}+k" = "neighboring_window up";
|
|
|
|
"${cmd}+j" = "neighboring_window down ";
|
2022-06-10 17:41:53 +00:00
|
|
|
"${cmd}+l" = "neighboring_window right";
|
2022-09-29 07:52:01 +00:00
|
|
|
## Detach window to its own tab
|
|
|
|
"${cmd}+d" = "detach_window new-tab";
|
|
|
|
## Change layout to fullscreen (stack) and back
|
|
|
|
"${cmd}+f" = "toggle_layout stack";
|
|
|
|
## Hints
|
|
|
|
"ctrl+shift+p>n" = "kitten hints --type=linenum --linenum-action=tab kak {path} +{line}";
|
2022-06-10 17:41:53 +00:00
|
|
|
}
|
|
|
|
# Tab bindings
|
|
|
|
// builtins.listToAttrs
|
|
|
|
(map
|
|
|
|
(x: attrsets.nameValuePair "${cmd}+${toString x}" "goto_tab ${toString x}")
|
|
|
|
(lists.range 1 9));
|
|
|
|
|
2022-06-11 15:59:56 +00:00
|
|
|
settings = {
|
2022-06-10 17:41:53 +00:00
|
|
|
# Tab settings
|
2022-10-09 15:12:29 +00:00
|
|
|
tab_bar_edge = "top";
|
2022-06-11 15:59:56 +00:00
|
|
|
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";
|
2022-06-10 17:41:53 +00:00
|
|
|
|
|
|
|
# Layouts
|
|
|
|
## Mouse focus
|
2022-06-11 15:59:56 +00:00
|
|
|
focus_follows_mouse = true;
|
2022-06-10 17:41:53 +00:00
|
|
|
## Layout options
|
|
|
|
# Layouts
|
2022-09-29 07:52:01 +00:00
|
|
|
enabled_layouts = "splits,stack";
|
2022-06-11 15:59:56 +00:00
|
|
|
inactive_text_alpha = "0.65";
|
2022-06-10 17:41:53 +00:00
|
|
|
|
|
|
|
# MacOS specific
|
2022-06-11 15:59:56 +00:00
|
|
|
macos_option_as_alt = "left";
|
|
|
|
};
|
2022-06-10 17:41:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|