# Configuration for Alacritty, the GPU enhanced terminal emulator.
# https://github.com/alacritty/alacritty/blob/master/alacritty.yml
window:
  opacity: 0.9
  dimensions:
    columns: 100
    lines: 30
  padding:
    x: 15
    y: 15
  decorations: buttonless
  startup_mode: Windowed
  dynamic_title: true
scrolling:
  history: 10000
  multiplier: 0
font:
  normal:
    family: FiraCode Nerd Font
  bold:
    family: FiraCode Nerd Font
    style: bold
  italic:
    family: FiraCode Nerd Font
    style: Italic
  bold_italic:
    family: FiraCode Nerd Font
    style: bold italic
  size: 20.0
  offset:
    x: 0
    y: 0
draw_bold_text_with_bright_colors: true
colors:
  primary:
    background: "#1d1f21"
    foreground: "#c5c8c6"
  cursor:
    text: CellBackground
    cursor: CellForeground
  vi_mode_cursor:
    text: CellBackground
    cursor: CellForeground
  selection:
    text: CellBackground
    background: CellForeground
  footer_bar:
    background: "#1d1f21"
    foreground: "#c5c8c6"
  search:
    matches:
      foreground: "#000000"
      background: "#ffffff"
cursor:
  style: Beam
  vi_mode_style: Block
  unfocused_hollow: true
  thickness: 0.25
live_config_reload: true
mouse:
  hide_when_typing: true
key_bindings:
  - { key: Paste, action: Paste }
  - { key: Copy, action: Copy }
  - { key: L, mods: Control, action: ClearLogNotice }
  - { key: L, mods: Control, mode: ~Vi, chars: "\x0c" }
  - { 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 }

  # Vi Mode
  - { key: Space, mods: Shift|Control, mode: Vi, action: ScrollToBottom }
  - { key: Space, mods: Shift|Control, action: ToggleViMode }
  - { key: Escape, mode: Vi, action: ClearSelection }
  - { key: I, mode: Vi, action: ScrollToBottom }
  - { key: I, mode: Vi, action: ToggleViMode }
  - { key: Y, mods: Control, mode: Vi, action: ScrollLineUp }
  - { key: E, mods: Control, mode: Vi, action: ScrollLineDown }
  - { key: G, mode: Vi, action: ScrollToTop }
  - { key: G, mods: Shift, mode: Vi, action: ScrollToBottom }
  - { key: B, mods: Control, mode: Vi, action: ScrollPageUp }
  - { key: F, mods: Control, mode: Vi, action: ScrollPageDown }
  - { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp }
  - { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown }
  - { key: Y, mode: Vi, action: Copy }
  - { key: Y, mode: Vi, action: ClearSelection }
  - { key: Copy, mode: Vi, action: ClearSelection }
  - { key: V, mode: Vi, action: ToggleNormalSelection }
  - { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection }
  - { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection }
  - { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection }
  - { key: Return, mode: Vi, action: Open }
  - { key: K, mode: Vi, action: Up }
  - { key: J, mode: Vi, action: Down }
  - { key: H, mode: Vi, action: Left }
  - { key: L, mode: Vi, action: Right }
  - { key: Up, mode: Vi, action: Up }
  - { key: Down, mode: Vi, action: Down }
  - { key: Left, mode: Vi, action: Left }
  - { key: Right, mode: Vi, action: Right }
  - { key: Key0, mode: Vi, action: First }
  - { key: Key4, mods: Shift, mode: Vi, action: Last }
  - { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied }
  - { key: H, mods: Shift, mode: Vi, action: High }
  - { key: M, mods: Shift, mode: Vi, action: Middle }
  - { key: L, mods: Shift, mode: Vi, action: Low }
  - { key: B, mode: Vi, action: SemanticLeft }
  - { key: W, mode: Vi, action: SemanticRight }
  - { key: E, mode: Vi, action: SemanticRightEnd }
  - { key: B, mods: Shift, mode: Vi, action: WordLeft }
  - { key: W, mods: Shift, mode: Vi, action: WordRight }
  - { key: E, mods: Shift, mode: Vi, action: WordRightEnd }
  - { key: Key5, mods: Shift, mode: Vi, action: Bracket }
  - { key: Slash, mode: Vi, action: SearchForward }
  - { key: Slash, mods: Shift, mode: Vi, action: SearchBackward }
  - { key: N, mode: Vi, action: SearchNext }
  - { key: N, mods: Shift, mode: Vi, action: SearchPrevious }
  # macOS only
  - { key: K, mods: Command, mode: ~Vi, chars: "\x0c" }
  - { key: Key0, mods: Command, action: ResetFontSize }
  - { key: Equals, mods: Command, action: IncreaseFontSize }
  - { key: K, mods: Command, action: ClearHistory }
  - { key: V, mods: Command, action: Paste }
  - { key: C, mods: Command, action: Copy }
  - { key: C, mods: Command, mode: Vi, action: ClearSelection }
  - { key: H, mods: Command, action: Hide }
  - { key: M, mods: Command, action: Minimize }
  - { key: Q, mods: Command, action: Quit }
  - { key: W, mods: Command, action: Quit }
  - { key: N, mods: Command, action: SpawnNewInstance }
  - { key: F, mods: Command|Control, action: ToggleFullscreen }
  - { key: F, mods: Command, action: SearchForward }
  - { key: B, mods: Command, action: SearchBackward }

# TokyoNight Alacritty Colors
import:
  - ~/.config/alacritty/themes/tokyonight_night.yml
