From 2b2732b5a2bc64963386ec6054b8a9facdf76d7b Mon Sep 17 00:00:00 2001 From: Nils Walther Date: Sun, 4 Jan 2026 13:08:25 +0100 Subject: [PATCH] alacritty vi mode + keybinds --- home/alacritty.nix | 84 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 5 deletions(-) diff --git a/home/alacritty.nix b/home/alacritty.nix index 70d91b3..9c9a198 100644 --- a/home/alacritty.nix +++ b/home/alacritty.nix @@ -6,16 +6,90 @@ settings = { general.import = [ "${config.home.homeDirectory}/.config/alacritty/colors.toml" ]; - env.TERM = "xterm-256color"; - window = { - opacity = 0.9; - padding = { x = 10; y = 10; }; + env = { + TERM = "xterm-256color"; + WINIT_X11_SCALE_FACTOR = "1"; }; - font.size = 12; + + window = { + dynamic_padding = true; + decorations = "full"; + title = "Alacritty@nixos"; + opacity = 0.8; + decorations_theme_variant = "Dark"; + dimensions = { + columns = 100; + lines = 30; + }; + class = { + instance = "Alacritty"; + general = "Alacritty"; + }; + }; + + scrolling = { + history = 10000; + multiplier = 3; + }; + + font = { + size = 12; + normal = { family = "monospace"; style = "Regular"; }; + bold = { family = "monospace"; style = "Bold"; }; + italic = { family = "monospace"; style = "Italic"; }; + bold_italic = { family = "monospace"; style = "Bold Italic"; }; + }; + + selection = { + semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"; + save_to_clipboard = true; + }; + + cursor = { + style = { + shape = "Beam"; + blinking = "Always"; + }; + vi_mode_style = { + shape = "Block"; + }; + unfocused_hollow = true; + thickness = 0.15; + }; + + mouse = { + hide_when_typing = true; + bindings = [ + { mouse = "Middle"; action = "PasteSelection"; } + ]; + }; + + keyboard.bindings = [ + { key = "Paste"; action = "Paste"; } + { key = "Copy"; action = "Copy"; } + { key = "L"; mods = "Control"; action = "ClearLogNotice"; } + { key = "L"; mods = "Control"; mode = "~Vi"; chars = "\f"; } + { key = "PageUp"; mods = "Shift"; mode = "~Alt"; action = "ScrollPageUp"; } + { key = "PageDown"; mods = "Shift"; mode = "~Alt"; action = "ScrollPageDown"; } + { key = "Home"; mods = "Shift"; mode = "~Alt"; action = "ScrollToTop"; } + { key = "End"; mods = "Shift"; mode = "~Alt"; action = "ScrollToBottom"; } + { key = "V"; mods = "Control|Shift"; action = "Paste"; } + { key = "C"; mods = "Control|Shift"; action = "Copy"; } + { key = "F"; mods = "Control|Shift"; action = "SearchForward"; } + { key = "B"; mods = "Control|Shift"; action = "SearchBackward"; } + { key = "C"; mods = "Control|Shift"; mode = "Vi"; action = "ClearSelection"; } + { key = "Key0"; mods = "Control"; action = "ResetFontSize"; } + ]; + + general = { + live_config_reload = true; + working_directory = "None"; # terminal.shell = { # program = "${pkgs.zellij}/bin/zellij"; # }; + }; }; }; } +