alacritty icon indicating copy to clipboard operation
alacritty copied to clipboard

Document installation via YAML anchors

Open arcticicestudio opened this issue 5 years ago • 3 comments

Like documented in the Alacritty wiki the configuration file can contain multiple color schemes by using the great YAML anchor and aliases feature. This is way better than the currently documented installation method that replaces the whole color scheme that was defined before. By using YAML anchors the user can simply switch between multiple themes without the need to copy & paste them every time but only changing the reference name of the colors field.

schemes:
  nord: &nord
    primary:
      #...
    cursor:
      # ...
    normal:
      #...
    bright:
      #...
    dim:
      # ...

colors: *nord

arcticicestudio avatar Aug 14 '20 06:08 arcticicestudio

Not sure if this will play into how we update the documentation but https://github.com/alacritty/alacritty/commit/3c3e6870dedad56b270f5b65ea57d5a6e46b1de6 was added recently and will allow importing additional config files to overwrite settings in the main config file.

It isn't in a released version yet. But I'm imagining we could add a line like

import:
  - ~/.config/alacritty/nord.yml

to the main config file and have it point to src/nord.yml file that the user would download from this repository.

amayer5125 avatar Sep 01 '20 17:09 amayer5125

@amayer5125 Thanks, that's exactly what I was hoping for to be added some day 🥳 That will be the recommended installation method since it won't mess with the users configuration file at all. I guess we can still add the YAML anchors to the documentation so we end up with…

  1. installation per theme file import (recommended, allows to use multiple themes without configuration file mess up)
  2. installation via YAML anchors (also allows to use multiple themes defined in the configuration file)
  3. manual installation via copy&paste of the Nord colors into the configuration file.

arcticicestudio avatar Sep 17 '20 09:09 arcticicestudio

Alacritty added the configuration file option for sourcing other files (import), in version 0.6.0, released on 2020-11-25.

jpcirrus avatar Aug 27 '22 08:08 jpcirrus