diff --git a/home/darwin.nix b/home/darwin.nix index 794ba5d..e13d16c 100644 --- a/home/darwin.nix +++ b/home/darwin.nix @@ -23,6 +23,7 @@ ../modules/lazygit ../modules/raycast ../modules/zellij + ../modules/ghostty ]; programs.home-manager.enable = true; diff --git a/modules/ghostty/default.nix b/modules/ghostty/default.nix index 5fce455..d314715 100644 --- a/modules/ghostty/default.nix +++ b/modules/ghostty/default.nix @@ -4,6 +4,7 @@ enableFishIntegration = true; installVimSyntax = true; clearDefaultKeybinds = true; + package = ""; settings = { theme = "Catppuccin Mocha"; font-size = 15; diff --git a/modules/zellij/config.kdl b/modules/zellij/config.kdl index e141132..71c091b 100644 --- a/modules/zellij/config.kdl +++ b/modules/zellij/config.kdl @@ -1,13 +1,42 @@ keybinds clear-defaults=true { + shared_except "locked" "scroll" { + bind "Esc" { SwitchToMode "Locked"; } + } + normal { - // uncomment this and adjust key if using copy_on_select=false - // bind "Alt c" { Copy; } + // Modes + bind "p" { SwitchToMode "Pane"; } + bind "r" { SwitchToMode "Resize"; } + bind "m" { SwitchToMode "Move"; } + bind "t" { SwitchToMode "Tab"; } + bind "s" { SwitchToMode "Scroll"; } + + // Global keybindings + bind "c" { NewTab; SwitchToMode "Locked"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "Locked"; } + bind "x" { CloseFocus; SwitchToMode "Locked"; } + bind "-" { NewPane "Down"; SwitchToMode "Locked"; } + bind "|" { NewPane "Right"; SwitchToMode "Locked"; } + bind "h" "Left" { MoveFocus "Left"; } + bind "l" "Right" { MoveFocus "Right"; } + bind "j" "Down" { MoveFocus "Down"; } + bind "k" "Up" { MoveFocus "Up"; } + bind "1" { GoToTab 1; SwitchToMode "Locked"; } + bind "2" { GoToTab 2; SwitchToMode "Locked"; } + bind "3" { GoToTab 3; SwitchToMode "Locked"; } + bind "4" { GoToTab 4; SwitchToMode "Locked"; } + bind "5" { GoToTab 5; SwitchToMode "Locked"; } + bind "6" { GoToTab 6; SwitchToMode "Locked"; } + bind "7" { GoToTab 7; SwitchToMode "Locked"; } + bind "8" { GoToTab 8; SwitchToMode "Locked"; } + bind "9" { GoToTab 9; SwitchToMode "Locked"; } } + locked { - bind "Ctrl g" { SwitchToMode "Normal"; } + bind "Ctrl b" { SwitchToMode "Normal"; } } + resize { - bind "Ctrl n" { SwitchToMode "Normal"; } bind "h" "Left" { Resize "Increase Left"; } bind "j" "Down" { Resize "Increase Down"; } bind "k" "Up" { Resize "Increase Up"; } @@ -19,27 +48,8 @@ keybinds clear-defaults=true { bind "=" "+" { Resize "Increase"; } bind "-" { Resize "Decrease"; } } - pane { - bind "Ctrl p" { SwitchToMode "Normal"; } - bind "h" "Left" { MoveFocus "Left"; } - bind "l" "Right" { MoveFocus "Right"; } - bind "j" "Down" { MoveFocus "Down"; } - bind "k" "Up" { MoveFocus "Up"; } - bind "p" { SwitchFocus; } - bind "n" { NewPane; SwitchToMode "Normal"; } - bind "d" { NewPane "Down"; SwitchToMode "Normal"; } - bind "r" { NewPane "Right"; SwitchToMode "Normal"; } - bind "s" { NewPane "stacked"; SwitchToMode "Normal"; } - bind "x" { CloseFocus; SwitchToMode "Normal"; } - bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; } - bind "z" { TogglePaneFrames; SwitchToMode "Normal"; } - bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; } - bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; } - bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;} - bind "i" { TogglePanePinned; SwitchToMode "Normal"; } - } + move { - bind "Ctrl h" { SwitchToMode "Normal"; } bind "n" "Tab" { MovePane; } bind "p" { MovePaneBackwards; } bind "h" "Left" { MovePane "Left"; } @@ -47,8 +57,17 @@ keybinds clear-defaults=true { bind "k" "Up" { MovePane "Up"; } bind "l" "Right" { MovePane "Right"; } } + + pane { + bind "n" { NewPane; SwitchToMode "Locked"; } + bind "x" { CloseFocus; SwitchToMode "Locked"; } + bind "p" { SwitchFocus; } + bind "f" { TogglePaneEmbedOrFloating; SwitchToMode "Locked"; } + bind "s" { NewPane "stacked"; SwitchToMode "Locked"; } + bind "r" { SwitchToMode "RenamePane"; } + } + tab { - bind "Ctrl t" { SwitchToMode "Normal"; } bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; } bind "h" "Left" "Up" "k" { GoToPreviousTab; } bind "l" "Right" "Down" "j" { GoToNextTab; } @@ -69,23 +88,36 @@ keybinds clear-defaults=true { bind "9" { GoToTab 9; SwitchToMode "Normal"; } bind "Tab" { ToggleTab; } } + + renamepane { + bind "Ctrl c" "Enter" { SwitchToMode "Locked"; } + bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; } + } + + renametab { + bind "Ctrl c" "Enter" { SwitchToMode "Locked"; } + bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; } + } + scroll { - bind "Ctrl s" { SwitchToMode "Normal"; } - bind "e" { EditScrollback; SwitchToMode "Normal"; } + bind "e" { EditScrollback; SwitchToMode "Locked"; } bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; } - bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "Ctrl c" "Esc" { ScrollToBottom; SwitchToMode "Locked"; } bind "j" "Down" { ScrollDown; } bind "k" "Up" { ScrollUp; } bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } bind "d" { HalfPageScrollDown; } bind "u" { HalfPageScrollUp; } - // uncomment this and adjust key if using copy_on_select=false - // bind "Alt c" { Copy; } } + + entersearch { + bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; } + bind "Enter" { SwitchToMode "Search"; } + } + search { - bind "Ctrl s" { SwitchToMode "Normal"; } - bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Locked"; } bind "j" "Down" { ScrollDown; } bind "k" "Up" { ScrollUp; } bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } @@ -98,218 +130,37 @@ keybinds clear-defaults=true { bind "w" { SearchToggleOption "Wrap"; } bind "o" { SearchToggleOption "WholeWord"; } } - entersearch { - bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; } - bind "Enter" { SwitchToMode "Search"; } - } - renametab { - bind "Ctrl c" { SwitchToMode "Normal"; } - bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; } - } - renamepane { - bind "Ctrl c" { SwitchToMode "Normal"; } - bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; } - } - session { - bind "Ctrl o" { SwitchToMode "Normal"; } - bind "Ctrl s" { SwitchToMode "Scroll"; } - bind "d" { Detach; } - bind "w" { - LaunchOrFocusPlugin "session-manager" { - floating true - move_to_focused_tab true - }; - SwitchToMode "Normal" - } - bind "c" { - LaunchOrFocusPlugin "configuration" { - floating true - move_to_focused_tab true - }; - SwitchToMode "Normal" - } - bind "p" { - LaunchOrFocusPlugin "plugin-manager" { - floating true - move_to_focused_tab true - }; - SwitchToMode "Normal" - } - bind "a" { - LaunchOrFocusPlugin "zellij:about" { - floating true - move_to_focused_tab true - }; - SwitchToMode "Normal" - } - bind "s" { - LaunchOrFocusPlugin "zellij:share" { - floating true - move_to_focused_tab true - }; - SwitchToMode "Normal" - } - } - tmux { - bind "[" { SwitchToMode "Scroll"; } - bind "Ctrl b" { Write 2; SwitchToMode "Normal"; } - bind "\"" { NewPane "Down"; SwitchToMode "Normal"; } - bind "%" { NewPane "Right"; SwitchToMode "Normal"; } - bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; } - bind "c" { NewTab; SwitchToMode "Normal"; } - bind "," { SwitchToMode "RenameTab"; } - bind "p" { GoToPreviousTab; SwitchToMode "Normal"; } - bind "n" { GoToNextTab; SwitchToMode "Normal"; } - bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; } - bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; } - bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; } - bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; } - bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; } - bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; } - bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; } - bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } - bind "o" { FocusNextPane; } - bind "d" { Detach; } - bind "Space" { NextSwapLayout; } - bind "x" { CloseFocus; SwitchToMode "Normal"; } - } - shared_except "locked" { - bind "Ctrl g" { SwitchToMode "Locked"; } - bind "Ctrl q" { Quit; } - bind "Alt f" { ToggleFloatingPanes; } - bind "Alt n" { NewPane; } - bind "Alt i" { MoveTab "Left"; } - bind "Alt o" { MoveTab "Right"; } - bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } - bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } - bind "Alt j" "Alt Down" { MoveFocus "Down"; } - bind "Alt k" "Alt Up" { MoveFocus "Up"; } - bind "Alt =" "Alt +" { Resize "Increase"; } - bind "Alt -" { Resize "Decrease"; } - bind "Alt [" { PreviousSwapLayout; } - bind "Alt ]" { NextSwapLayout; } - bind "Alt p" { TogglePaneInGroup; } - bind "Alt Shift p" { ToggleGroupMarking; } - } - shared_except "normal" "locked" { - bind "Enter" "Esc" { SwitchToMode "Normal"; } - } - shared_except "pane" "locked" { - bind "Ctrl p" { SwitchToMode "Pane"; } - } - shared_except "resize" "locked" { - bind "Ctrl n" { SwitchToMode "Resize"; } - } - shared_except "scroll" "locked" { - bind "Ctrl s" { SwitchToMode "Scroll"; } - } - shared_except "session" "locked" { - bind "Ctrl o" { SwitchToMode "Session"; } - } - shared_except "tab" "locked" { - bind "Ctrl t" { SwitchToMode "Tab"; } - } - shared_except "move" "locked" { - bind "Ctrl h" { SwitchToMode "Move"; } - } - shared_except "tmux" "locked" { - bind "Ctrl b" { SwitchToMode "Tmux"; } - } + + tmux { } } -// Plugin aliases - can be used to change the implementation of Zellij -// changing these requires a restart to take effect -plugins { - tab-bar location="zellij:tab-bar" - status-bar location="zellij:status-bar" - strider location="zellij:strider" - compact-bar location="zellij:compact-bar" - session-manager location="zellij:session-manager" - welcome-screen location="zellij:session-manager" { - welcome_screen true - } - filepicker location="zellij:strider" { - cwd "/" - } - configuration location="zellij:configuration" - plugin-manager location="zellij:plugin-manager" - about location="zellij:about" -} - -// Plugins to load in the background when a new session starts -load_plugins { - // "file:/path/to/my-plugin.wasm" - // "https://example.com/my-plugin.wasm" -} - -// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP -// eg. when terminal window with an active zellij session is closed -// (Requires restart) -// Options: -// - detach (Default) -// - quit -// -// on_force_close "quit" - -// Send a request for a simplified ui (without arrow fonts) to plugins -// Options: -// - true -// - false (Default) -// -simplified_ui false - -// Choose the path to the default shell that zellij will use for opening new panes -// Default: $SHELL -// -default_shell "fish" - -// Choose the path to override cwd that zellij will use for opening new panes -// -// default_cwd "" - -// Toggle between having pane frames around the panes -// Options: -// - true (default) -// - false -// -// pane_frames true - -// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible -// Options: -// - true (default) -// - false -// -// auto_layout true - -// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected -// (Requires restart) -// Options: -// - true (default) -// - false -// -// session_serialization false - -// Whether pane viewports are serialized along with the session, default is false -// (Requires restart) -// Options: -// - true -// - false (default) -// -// serialize_pane_viewport true - -// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0 -// defaults to the scrollback size. If this number is higher than the scrollback size, it will -// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true. -// (Requires restart) -// -// scrollback_lines_to_serialize 10000 - -// Define color themes for Zellij -// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes -// Once these themes are defined, one of them should to be selected in the "theme" section of this file -// +theme "winterly" themes { winterly { + text_unselected { + base 255 255 255 + background 15 11 21 + emphasis_0 245 194 231 + emphasis_1 166 227 161 + emphasis_2 137 220 235 + emphasis_3 250 179 135 + } + text_selected { + base 205 214 244 + background 87 36 84 + emphasis_0 250 179 135 + emphasis_1 137 220 235 + emphasis_2 166 227 161 + emphasis_3 245 194 231 + } + ribbon_selected { + base 15 11 21 + background 175 133 234 + emphasis_0 252 193 182 + emphasis_1 191 138 159 + emphasis_2 53 175 191 + emphasis_3 197 127 175 + } ribbon_unselected { base 128 124 159 background 29 32 47 @@ -318,16 +169,46 @@ themes { emphasis_2 53 175 191 emphasis_3 197 127 175 } - - ribbon_selected { + table_title { base 255 255 255 - background 87 36 84 // 211 105 175 // 197 127 175 - emphasis_0 252 193 182 - emphasis_1 191 138 159 - emphasis_2 53 175 191 - emphasis_3 197 127 175 + background 15 11 21 + emphasis_0 250 179 135 + emphasis_1 137 220 235 + emphasis_2 166 227 161 + emphasis_3 245 194 231 + } + table_cell_selected { + base 205 214 244 + background 87 36 84 + emphasis_0 250 179 135 + emphasis_1 137 220 235 + emphasis_2 166 227 161 + emphasis_3 245 194 231 + } + table_cell_unselected { + base 255 255 255 + background 15 11 21 + emphasis_0 250 179 135 + emphasis_1 137 220 235 + emphasis_2 166 227 161 + emphasis_3 245 194 231 + } + list_selected { + base 205 214 244 + background 87 36 84 + emphasis_0 250 179 135 + emphasis_1 137 220 235 + emphasis_2 166 227 161 + emphasis_3 245 194 231 + } + list_unselected { + base 255 255 255 + background 15 11 21 + emphasis_0 250 179 135 + emphasis_1 137 220 235 + emphasis_2 166 227 161 + emphasis_3 245 194 231 } - frame_selected { base 197 127 175 background 0 @@ -336,7 +217,6 @@ themes { emphasis_2 0 emphasis_3 0 } - frame_unselected { base 128 124 159 background 0 @@ -345,7 +225,6 @@ themes { emphasis_2 0 emphasis_3 0 } - frame_highlight { base 197 127 175 background 0 @@ -354,211 +233,64 @@ themes { emphasis_2 0 emphasis_3 0 } - - text_selected { - base 205 214 244 - background 87 36 84 - // todo from here - emphasis_0 250 179 135 - emphasis_1 137 220 235 - emphasis_2 166 227 161 - emphasis_3 245 194 231 + exit_code_success { + base 154 + background 238 + emphasis_0 51 + emphasis_1 16 + emphasis_2 201 + emphasis_3 45 + } + exit_code_error { + base 255 106 122 + background 0 + emphasis_0 0 + emphasis_1 0 + emphasis_2 0 + emphasis_3 0 + } + multiplayer_user_colors { + player_1 201 + player_2 45 + player_3 99 + player_4 226 + player_5 51 + player_6 136 + player_7 124 + player_8 245 + player_9 207 + player_10 215 } } } -theme "winterly" - -// Choose the theme that is specified in the themes section. -// Default: default -// -// theme "default" - -// The name of the default layout to load on startup -// Default: "default" -// (Requires restart) -// -// default_layout "compact" - -// Choose the mode that zellij uses when starting up. -// Default: normal -// -// default_mode "locked" - -// Toggle enabling the mouse mode. -// On certain configurations, or terminals this could -// potentially interfere with copying text. -// (Requires restart) -// Options: -// - true (default) -// - false -// -// mouse_mode false - -// Configure the scroll back buffer size -// This is the number of lines zellij stores for each pane in the scroll back -// buffer. Excess number of lines are discarded in a FIFO fashion. -// (Requires restart) -// Valid values: positive integers -// Default value: 10000 -// -// scroll_buffer_size 10000 - -// Provide a command to execute when copying text. The text will be piped to -// the stdin of the program to perform the copy. This can be used with -// terminal emulators which do not support the OSC 52 ANSI control sequence -// that will be used by default if this option is not set. -// Examples: -// -// copy_command "xclip -selection clipboard" // x11 -// copy_command "wl-copy" // wayland -// copy_command "pbcopy" // osx - -// Choose the destination for copied text -// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. -// Does not apply when using copy_command. -// Options: -// - system (default) -// - primary -// -// copy_clipboard "primary" - -// Enable or disable automatic copy (and clear) of selection when releasing mouse -// Default: true -// -// copy_on_select false - -// Path to the default editor to use to edit pane scrollbuffer -// Default: $EDITOR or $VISUAL -// -// scrollback_editor "/usr/bin/vim" - -// When attaching to an existing session with other users, -// should the session be mirrored (true) -// or should each user have their own cursor (false) -// (Requires restart) -// Default: false -// -// mirror_session true - -// The folder in which Zellij will look for layouts -// (Requires restart) -// -// layout_dir "/path/to/my/layout_dir" - -// The folder in which Zellij will look for themes -// (Requires restart) -// -// theme_dir "/path/to/my/theme_dir" - -// Enable or disable the rendering of styled and colored underlines (undercurl). -// May need to be disabled for certain unsupported terminals -// (Requires restart) -// Default: true -// -// styled_underlines false - -// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know -// metadata info on this session) -// (Requires restart) -// Default: false -// -// disable_session_metadata true - -// Enable or disable support for the enhanced Kitty Keyboard Protocol (the host terminal must also support it) -// (Requires restart) -// Default: true (if the host terminal supports it) -// -// support_kitty_keyboard_protocol false - -// Whether to make sure a local web server is running when a new Zellij session starts. -// This web server will allow creating new sessions and attaching to existing ones that have -// opted in to being shared in the browser. -// When enabled, navigate to http://127.0.0.1:8082 -// (Requires restart) -// -// Note: a local web server can still be manually started from within a Zellij session or from the CLI. -// If this is not desired, one can use a version of Zellij compiled without -// `web_server_capability` -// -// Possible values: -// - true -// - false -// Default: false -// -// web_server true - -// Whether to allow sessions started in the terminal to be shared through a local web server, assuming one is -// running (see the `web_server` option for more details). -// (Requires restart) -// -// Note: This is an administrative separation and not intended as a security measure. -// -// Possible values: -// - "on" (allow web sharing through the local web server if it -// is online) -// - "off" (do not allow web sharing unless sessions explicitly opt-in to it) -// - "disabled" (do not allow web sharing and do not permit sessions started in the terminal to opt-in to it) -// Default: "off" -// -// web_sharing "on" - -// The ip address the web server should listen on when it starts -// Default: "127.0.0.1" -// (Requires restart) -// -// web_server_ip "127.0.0.1" - - -// A path to a certificate file to be used when setting up the web client to serve the -// connection over HTTPs -// -// web_server_cert "/path/to/my/cert.pem" - -// A path to a key file to be used when setting up the web client to serve the -// connection over HTTPs -// -// web_server_key "/path/to/my/key.pem" - -// Whether to enforce https connections to the web server when it is bound to localhost -// (127.0.0.0/8) -// -// Note: https is ALWAYS enforced when bound to non-local interfaces -// -// Default: false -// -// enforce_https_for_localhost true - -// The port the web server should listen on when it starts -// Default: 8082 -// (Requires restart) -// -// web_server_port 8082 - -// Whether to stack panes when resizing beyond a certain size -// Default: true -// -// stacked_resize false - -// Whether to show release notes on first version run -// Default: true -// -// show_release_notes false - -// Whether to enable mouse hover effects and pane grouping functionality -// Default: true -// -// advanced_mouse_actions false - -// A command to run (will be wrapped with sh -c and provided the RESURRECT_COMMAND env variable) -// after Zellij attempts to discover a command inside a pane when resurrecting sessions, the STDOUT -// of this command will be used instead of the discovered RESURRECT_COMMAND -// can be useful for removing wrappers around commands -// Note: be sure to escape backslashes and similar characters properly -// -// post_command_discovery_hook "echo $RESURRECT_COMMAND | sed " - - -web_client { - font "monospace" +plugins { + about location="zellij:about" + compact-bar location="zellij:compact-bar" + configuration location="zellij:configuration" + filepicker location="zellij:strider" { + cwd "/" + } + plugin-manager location="zellij:plugin-manager" + session-manager location="zellij:session-manager" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + tab-bar location="zellij:tab-bar" + welcome-screen location="zellij:session-manager" { + welcome_screen false + } } + +load_plugins { +} + +default_mode "locked" +default_shell "fish" +pane_frames true +scroll_buffer_size 100000 +copy_on_select true +attach_to_session true +session_name "default" +serialization_interval 3600 +web_server false +show_startup_tips false