From 67cec99dda2a7a347a0983d1237eb8c9993e60a0 Mon Sep 17 00:00:00 2001 From: Francis Hamel <36383308+francishamel@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:43:17 -0400 Subject: [PATCH] Fix alacritty keybindings --- home-manager/modules/alacritty.nix | 10 ++++++++++ home-manager/modules/zsh/common.nix | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/alacritty.nix b/home-manager/modules/alacritty.nix index 626aa94..e429878 100644 --- a/home-manager/modules/alacritty.nix +++ b/home-manager/modules/alacritty.nix @@ -10,6 +10,16 @@ startup_mode = "Maximized"; title = "Alacritty"; }; + + # See https://portal.cs.umbc.edu/help/theory/ascii.txt + keyboard.bindings = [ + { key = "Backspace"; mods = "Command"; chars = "\\u0015"; } + { key = "Backspace"; mods = "Alt"; chars = "\\u0017"; } + { key = "Left"; mods = "Command"; chars = "\\u0001"; } + { key = "Right"; mods = "Command"; chars = "\\u0005"; } + { key = "Left"; mods = "Alt"; chars = "\\u001b\\u0062"; } + { key = "Right"; mods = "Alt"; chars = "\\u001b\\u0066"; } + ]; }; }; } diff --git a/home-manager/modules/zsh/common.nix b/home-manager/modules/zsh/common.nix index 84a9c83..1292f0b 100644 --- a/home-manager/modules/zsh/common.nix +++ b/home-manager/modules/zsh/common.nix @@ -2,10 +2,12 @@ { programs.zsh = { - defaultKeymap = "emacs"; dotDir = ".config/zsh"; enable = true; historySubstringSearch.enable = true; shellAliases.".." = "cd .."; + initExtra = '' + bindkey '^U' backward-kill-line + ''; }; }