<commit_before># -*- org-src-preserve-indentation: t; org-edit-src-content-indentation: 0; -*-
#+TITLE: Alacritty Configuration
#+SUBTITLE: Configuration file for the Alacritty terminal emulator
#+AUTHOR: <NAME>
#+EMAIL: <EMAIL>
#+DATE: 2019-10-22
#  LocalWords:  Alacritty

* Preface
#+BEGIN_SRC yaml :tangle yes :tangle alacritty.yml
#   ___  _                 _ _   _         
#  / _ \| |               (_) | | |        
# / /_\ \ | __ _  ___ _ __ _| |_| |_ _   _ 
# |  _  | |/ _` |/ __| '__| | __| __| | | |
# | | | | | (_| | (__| |  | | |_| |_| |_| |
# \_| |_/_|\__,_|\___|_|  |_|\__|\__|\__, |
#                                     __/ |
#                                    |___/ 
window:
  padding:
    x: 5

colors:
  primary:
    background: '0xFFFFFF'
    foreground: '0x333333'

  cursor:
    text: '0x333333'
    cursor: '0x21BDFF'

  normal:
    black:   '0x000000'
    red:     '0xFF0000'
    green:   '0x008000'
    yellow:  '0xFFD700'
    blue:    '0x335EA8'
    magenta: '0x6434A3'
    cyan:    '0x88C0D0'
    white:   '0xA7A7A7'

  bright:
    black:   '0x8D8D8D'
    red:     '0xFFB400'
    green:   '0x00FF00'
    yellow:  '0xF6FECD'
    blue:    '0x008ED1'
    magenta: '0xBA36A5'
    cyan:    '0xE5F4FB'
    white:   '0x9A9A9A'

              # Font configuration (changes require restart)
font:
  size: 13
  normal:
    family: Iosevka Term SS04
    style: Medium

    bold:
      family: Iosevka Term SS04
      style: Bold

      italic:
        family: Iosevka Term SS04
        style: Oblique, Medium
#+END_SRC
<commit_msg>Complete the remainder of the Alacritty configuration<commit_after># -*- org-src-preserve-indentation: t; org-edit-src-content-indentation: 0; -*-
#+TITLE: Alacritty Configuration
#+SUBTITLE: Configuration file for the Alacritty terminal emulator
#+AUTHOR: <NAME>
#+EMAIL: <EMAIL>
#  LocalWords:  Alacritty Iosevka Leuven

* Preface
#+BEGIN_SRC yaml :tangle yes :tangle alacritty.yml
#   ___  _                 _ _   _         
#  / _ \| |               (_) | | |        
# / /_\ \ | __ _  ___ _ __ _| |_| |_ _   _ 
# |  _  | |/ _` |/ __| '__| | __| __| | | |
# | | | | | (_| | (__| |  | | |_| |_| |_| |
# \_| |_/_|\__,_|\___|_|  |_|\__|\__|\__, |
#                                     __/ |
#                                    |___/ 
#+END_SRC

* The Window
	The ~window~ collection defines how Alacritty is drawn to the screen. I add a
	bit of padding between the sides of the window and the terminal. Without it,
	the text is uncomfortably close to the edge of the monitor.

#+BEGIN_SRC yaml :tangle yes :tangle alacritty.yml
window:
  padding:
    x: 5
  dynamic_padding: true # Adds a bit more space in some situations
  startup_mode: Maximized
#+END_SRC

* Fonts
	Configure the use of the Iosevka font. As well, disable converting all bold
	text to use the bright colours.

#+BEGIN_SRC yaml :tangle yes :tangle alacritty.yml
font:
  normal:
    family: Iosevka Term SS04
    style: Medium

  bold:
    family: Iosevka Term SS04
    style: Bold

  italic:
    family: Iosevka Term SS04
    style: Oblique, Medium

  size: 13

draw_bold_text_with_bright_colors: false
#+END_SRC

* Colours
	My colours scheme is derived from the [[https://github.com/fniessen/emacs-leuven-theme][Leuven Theme]]
	for Emacs. For some elements (e.g. primary background and foreground colours)
	it was obvious which Leuven face was needed. Other colours were not as simple.
	Brighter colours, like cyan or yellow, are used mostly by Leuven as background
	or highlight faces. This makes them unusable for text colour, especially
	if it is directly against the pure white background.
	
	I have annotated each colour in this configuration with a comment declaring
	which Leuven color class or custom face I lifted the value from.

 #+BEGIN_SRC yaml :tangle yes :tangle alacritty.yml
colors:
  primary:
    background: '0xFFFFFF' # default :background
    foreground: '0x333333' # default :foreground

  cursor:
    text: '0x333333' # default :foreground
    cursor: '0x21BDFF' # cursor :background

  selection:
    background: '0x8ED3FF' # region :background

  normal:
    black:   '0x000000'
    red:     '0xFE251E' # flycheck-error :underline :color
    green:   '0x008000' # string :foreground
    yellow:  '0xFFA500' # warning :foreground
    blue:    '0x000088' # code-block :foreground
    magenta: '0x6434A3' # font-lock-type-face :foreground
    cyan:    '0x123555' # ol2 :overline
    white:   '0x8D8D84' # font-lock-comment-face :foreground

  bright:
    black:   '0x555555' # org-block-begin-line :foreground
    red:     '0xFF0000' # gnus-group-news-4 :foreground
    green:   '0x158A15' # flycheck-fringe-info :foreground
    yellow:  '0xF4B400' # ???
    blue:    '0x335EA8' # mode-line :box :background
    magenta: '0xBA36A5' # font-lock-variable-name-face :foreground
    cyan:    '0x008ED1' # org-meta-line :foreground
    white:   '0x9A9A9A' # linum :foreground
#+END_SRC

* Mouse
	The only mouse setting I change is to copy selected text to the primary
	clipboard. This way I can select output and quickly paste it elsewhere.
	For example, throwing errors into a search engine.

#+BEGIN_SRC yaml :tangle yes :tangle alacritty.yml
selection:
  save_to_clipboard: true
#+END_SRC

{'fraction_non_alphanumeric': 0.11145096539858536, 'fraction_numerical': 0.04415981647868476, 'mean_word_length': 2.571331058020478, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5644566', 'n_tokens_mistral': 2049, 'n_tokens_neox': 1883, 'n_words': 499}