From 6c4e68936684597a0668419c0121df13e27335c0 Mon Sep 17 00:00:00 2001 From: Kirill Gashkov Date: Wed, 10 Jan 2024 14:35:26 +0500 Subject: [PATCH] Migrate Alacritty config from YAML to TOML --- dotfiles/config/alacritty/alacritty.toml | 56 ++++++++++++++++++++++ dotfiles/config/alacritty/alacritty.yml | 60 ------------------------ 2 files changed, 56 insertions(+), 60 deletions(-) create mode 100644 dotfiles/config/alacritty/alacritty.toml delete mode 100644 dotfiles/config/alacritty/alacritty.yml diff --git a/dotfiles/config/alacritty/alacritty.toml b/dotfiles/config/alacritty/alacritty.toml new file mode 100644 index 0000000..a7c7118 --- /dev/null +++ b/dotfiles/config/alacritty/alacritty.toml @@ -0,0 +1,56 @@ +[window] +padding.x = 10 +padding.y = 10 +dynamic_padding = true +decorations = "buttonless" +opacity = 0.9 + +[font] +normal.family = "JetBrainsMono Nerd Font Mono" +size = 13.0 +offset.y = 10 +glyph_offset.y = 5 + +[shell] +program = "/usr/local/bin/tmux" +args = [ + "start-server", + ";", + "run-shell", + "/usr/local/bin/tmux has-session || /usr/local/bin/tmux new-session -d -s \"-\"", + ";", + "attach-session" +] + +[keyboard] +bindings = [ + { key = "N", mods = "Command", chars = "\u0002\u0063" }, # New window (C-b c) + { key = "N", mods = "Command|Shift", chars = "\u0002\u001b\u0043" }, # New session (C-b M-C) (User-defined) + { key = "D", mods = "Command", chars = "\u0002\u0025" }, # Split pane vertically (C-b %) + { key = "D", mods = "Command|Shift", chars = "\u0002\u0022" }, # Split pane horizontally (C-b ") + { key = "R", mods = "Command", chars = "\u0002\u001b\u0052" }, # Restart pane (C-b M-R) (User-defined) + { key = "W", mods = "Command", chars = "\u0002\u0078" }, # Close pane (C-b x) + { key = "W", mods = "Command|Shift", chars = "\u0002\u001b\u0058" }, # Close session (C-b M-X) (User-defined) + + { key = "K", mods = "Command|Shift", chars = "\u0002\u001b\u004b" }, # Clear scrollback buffer (C-b M-K) (User-defined) + { key = "Y", mods = "Command", chars = "\u0002\u001b\u007b" }, # Toggle copy mode (C-b M-{) (User-defined) + { key = "Z", mods = "Command", chars = "\u0002\u007a" }, # Toggle zoom (C-b z) + + { key = "H", mods = "Command", chars = "\u0002\u001b\u005b\u0044" }, # Focus left pane (C-b Left) + { key = "L", mods = "Command", chars = "\u0002\u001b\u005b\u0043" }, # Focus right pane (C-b Right) + { key = "K", mods = "Command", chars = "\u0002\u001b\u005b\u0041" }, # Focus top pane (C-b Up) + { key = "J", mods = "Command", chars = "\u0002\u001b\u005b\u0042" }, # Focus bottom pane (C-b Down) + + { key = "Key1", mods = "Command", chars = "\u0002\u0031" }, # Focus window 1 (C-b 1) + { key = "Key2", mods = "Command", chars = "\u0002\u0032" }, # Focus window 2 (C-b 2) + { key = "Key3", mods = "Command", chars = "\u0002\u0033" }, # Focus window 3 (C-b 3) + { key = "Key4", mods = "Command", chars = "\u0002\u0034" }, # Focus window 4 (C-b 4) + { key = "Key5", mods = "Command", chars = "\u0002\u0035" }, # Focus window 5 (C-b 5) + { key = "Key6", mods = "Command", chars = "\u0002\u0036" }, # Focus window 6 (C-b 6) + { key = "Key7", mods = "Command", chars = "\u0002\u0037" }, # Focus window 7 (C-b 7) + { key = "Key8", mods = "Command", chars = "\u0002\u0038" }, # Focus window 8 (C-b 8) + { key = "Key9", mods = "Command", chars = "\u0002\u001b\u0028" }, # Focus last window (C-b M-() (User-defined) + + { key = "P", mods = "Command", chars = "\u0002\u001b\u0053" }, # Go to session (C-b M-S) (User-defined) + { key = "P", mods = "Command|Shift", chars = "\u0002\u001b\u0050" } # Command palette (C-b M-P) (User-defined) +] diff --git a/dotfiles/config/alacritty/alacritty.yml b/dotfiles/config/alacritty/alacritty.yml deleted file mode 100644 index b891b44..0000000 --- a/dotfiles/config/alacritty/alacritty.yml +++ /dev/null @@ -1,60 +0,0 @@ -window: - padding: - x: 10 - y: 10 - dynamic_padding: true - decorations: buttonless - opacity: 0.9 - -font: - normal: - family: JetBrainsMono Nerd Font Mono - size: 13.0 - offset: - y: 10 - glyph_offset: - y: 5 - -import: - - ~/.config/alacritty/themes/tomorrow_night.yaml - -shell: - program: /usr/local/bin/tmux - args: - - start-server - - ; - - run-shell - - /usr/local/bin/tmux has-session || /usr/local/bin/tmux new-session -d -s "-" - - ; - - attach-session - -key_bindings: - - { key: N, mods: Command, chars: "\x02\x63" } # New window (C-b c) - - { key: N, mods: Command|Shift, chars: "\x02\x1b\x43" } # New session (C-b M-C) (User-defined) - - { key: D, mods: Command, chars: "\x02\x25" } # Split pane vertically (C-b %) - - { key: D, mods: Command|Shift, chars: "\x02\x22" } # Split pane horizontally (C-b ") - - { key: R, mods: Command, chars: "\x02\x1b\x52" } # Restart pane (C-b M-R) (User-defined) - - { key: W, mods: Command, chars: "\x02\x78" } # Close pane (C-b x) - - { key: W, mods: Command|Shift, chars: "\x02\x1b\x58" } # Close session (C-b M-X) (User-defined) - - - { key: K, mods: Command|Shift, chars: "\x02\x1b\x4b" } # Clear scrollback buffer (C-b M-K) (User-defined) - - { key: Y, mods: Command, chars: "\x02\x1b\x7b" } # Toggle copy mode (C-b M-{) (User-defined) - - { key: Z, mods: Command, chars: "\x02\x7a" } # Toggle zoom (C-b z) - - - { key: H, mods: Command, chars: "\x02\x1b\x5b\x44" } # Focus left pane (C-b Left) - - { key: L, mods: Command, chars: "\x02\x1b\x5b\x43" } # Focus right pane (C-b Right) - - { key: K, mods: Command, chars: "\x02\x1b\x5b\x41" } # Focus top pane (C-b Up) - - { key: J, mods: Command, chars: "\x02\x1b\x5b\x42" } # Focus bottom pane (C-b Down) - - - { key: Key1, mods: Command, chars: "\x02\x31" } # Focus window 1 (C-b 1) - - { key: Key2, mods: Command, chars: "\x02\x32" } # Focus window 2 (C-b 2) - - { key: Key3, mods: Command, chars: "\x02\x33" } # Focus window 3 (C-b 3) - - { key: Key4, mods: Command, chars: "\x02\x34" } # Focus window 4 (C-b 4) - - { key: Key5, mods: Command, chars: "\x02\x35" } # Focus window 5 (C-b 5) - - { key: Key6, mods: Command, chars: "\x02\x36" } # Focus window 6 (C-b 6) - - { key: Key7, mods: Command, chars: "\x02\x37" } # Focus window 7 (C-b 7) - - { key: Key8, mods: Command, chars: "\x02\x38" } # Focus window 8 (C-b 8) - - { key: Key9, mods: Command, chars: "\x02\x1b\x28" } # Focus last window (C-b M-() (User-defined) - - - { key: P, mods: Command, chars: "\x02\x1b\x53" } # Go to session (C-b M-S) (User-defined) - - { key: P, mods: Command|Shift, chars: "\x02\x1b\x50" } # Command palette (C-b M-P) (User-defined)