My literate configuration and notes for Alacritty.

Colorschemes§

Scrivi qui la palette che vuoi usare:

tokyo-night

Da qui in avanti, elenchiamo le palette disponibili.

schemes:

tokyo-night§

Tokyo Night theme, based on both:

  tokyo-night: &tokyo-night
    # Default colors
    primary:
      background: '0x1a1b26'
      foreground: '0xa9b1d6'

    # Normal colors
    normal:
      black:   '0x32344a'
      red:     '0xf7768e'
      green:   '0x9ece6a'
      yellow:  '0xe0af68'
      blue:    '0x7aa2f7'
      magenta: '0xad8ee6'
      cyan:    '0x449dab'
      white:   '0x787c99'

    # Bright colors
    bright:
      black:   '0x444b6a'
      red:     '0xff7a93'
      green:   '0xb9f27c'
      yellow:  '0xff9e64'
      blue:    '0x7da6ff'
      magenta: '0xbb9af7'
      cyan:    '0x0db9d7'
      white:   '0xacb0d0'

tokyo-night-storm§

  tokyo-night-storm: &tokyo-night-storm
    # Default colors
    primary:
      background: '0x24283b'
      foreground: '0xa9b1d6'

    # Normal colors
    normal:
      black:   '0x32344a'
      red:     '0xf7768e'
      green:   '0x9ece6a'
      yellow:  '0xe0af68'
      blue:    '0x7aa2f7'
      magenta: '0xad8ee6'
      cyan:    '0x449dab'
      white:   '0x9699a8'

    # Bright colors
    bright:
      black:   '0x444b6a'
      red:     '0xff7a93'
      green:   '0xb9f27c'
      yellow:  '0xff9e64'
      blue:    '0x7da6ff'
      magenta: '0xbb9af7'
      cyan:    '0x0db9d7'
      white:   '0xacb0d0'

Select color (enabled?)§

Nessun colore selezionato al momento. Alacritty usa la palette di default. Puoi commentare questa riga per disabilitare la scelta del colorscheme.

# colors: *tokyo-night

GNOME/Files (Nautilus)§

Il file manager di Gnome (detto Nautilus fino alla versione 3.6) consente di aprire un terminale nella cartella che si sta visitando, semplicemente accedendo al menù a tendina con il tasto destro. Nulla di sorprendente, si tratta di una funzione familiare, comune a circa ogni file manager esistente su desktop. Peccato che questa funzione si limiti all'apertura di gnome-terminal. E se utilizzassimo un altro emulatore di terminale? Alacritty per esempio?

Ci viene in soccorso un piccolo plugin.

Si può installare da AUR:

yay -S nautilus-open-any-terminal

A questo punto, consiglio di usare dconf-editor per configurarlo e specificare che vogliamo aprire alacritty. Se non l'avete già installato:

sudo pacman -S dconf-editor

Quindi aprire, andare su /com/github/stunkymonkey/nautilus-open-any-terminal/.

Alla voce terminal, specificare 'alacritty'. Per altri sistemi e installazioni alternative, consultare il README.

Key bindings§

key_bindings:

Zoom (dimensione temporanea del font)§

Premere:

  • CTRL + per aumentare;
  • CTRL - per diminuire;
  • CTRL = per resettare;

Si possono aggiungere altre bindings su alacritty.yml (vedi qua).

Nuova istanza di Alacritty nella stessa directory§

Aggiungi un paio di linee al file di configurazione per fare apparire una nuova istanza di Alacritty nella directory di lavoro con Ctrl+Shift+Enter (dalla wiki di Arch).

  - { key: Return,   mods: Control|Shift, action: SpawnNewInstance }

Vi mode§

Solitamente, quando voglio copiare qualcosa dall'output di alacritty, uso la cosiddetta vi-mode. Come insegna la wiki di Arch,

The vi mode allows moving around Alacritty's viewport and scrollback using the keyboard. By default you can toggle it using Ctrl+Shift+Space. To copy, you can either use a mouse to select and press Ctrl+Shift+c, or enter Vi mode, start a selection using v, move around with `hjkl` like in vim, and copy the selection with y. To paste, press Ctrl+Shift+v. To copy/paste to/from X clipboard, you can use a mouse selection to copy and a middle mouse click to paste.