Search code examples
macosshellyamlalacritty

Alacritty delete line with Cmd + Backspace


Recently switched from Iterm to Alacritty for various reasons. One thing that I'm now realizing I used a lot is command + backspace to delete and entire line (Yes I'm aware of CTR + U, but that's not muscle memory for me). Is there a way to set up a shortcut for line clear in alacrity?


Solution

  • Adding the line - { key: Back, mods: Command, chars: "\x15" } to the alacritty.yml file will delete the entire line with "Cmd+Backspace" on macOS.

    Also, here are some additional keybinding changes I've made to my alacritty setup that may make your life easier (per https://github.com/alacritty/alacritty/issues/474#issuecomment-338803299):

      - { key: Left,     mods: Alt,     chars: "\x1bb"                       } # Skip word left
      - { key: Right,    mods: Alt,     chars: "\x1bf"                       } # Skip word right
      - { key: Left,     mods: Command, chars: "\x1bOH",   mode: AppCursor   } # Home
      - { key: Right,    mods: Command, chars: "\x1bOF",   mode: AppCursor   } # End
      - { key: Back,     mods: Command, chars: "\x15"                        } # Delete line
      - { key: Back,     mods: Alt,     chars: "\x1b\x7f"                    } # Delete word