Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

Latest commit

 

History

History
243 lines (196 loc) · 6.02 KB

File metadata and controls

243 lines (196 loc) · 6.02 KB

Alacritty

Alacritty is cross-platform, OpenGL terminal emulator superseding Termite which I used so far.

Install

Arch Linux

alacritty-git latest aur
ttf-inconsolata-go-nerd latest aur

Multiple Monitors with different DPI

By default, Alacritty adjusting font-size according to DPI, which results in bigger/smaller font on second monitor.

I simply can’t grasp the reason for this. In my case, when I setup desired font size on my 2k monitor, it result in huge font on HD monitor. Which is ironic, as you get even less of terminal space…

Anyway no big deal, according to this issue, you can simply set WINIT_X11_SCALE_FACTOR=1 environment variable and it works as I want (same as Termite before).

Looks like it works on Wayland without any issue.

Options

TERM

This value is used to set the $TERM environment variable for each instance of Alacritty. If it is not present, alacritty will check the local terminfo database and use alacritty if it is available, otherwise xterm-256color is used.

That would be find but it isn’t working for me as I’m often logging to remote machines with SSH and alacritty is missing there in most cases.

[env]
TERM = "xterm-256color"

Scrolling

Looks like 10000 lines is maximum we can get :/ Termite has infinite history, which I strongly prefer. Nothing worse than loosing something important because I can’t scroll back enough.

[scrolling]
history = 10000

Padding

Blank space added around the window in pixels. This padding is scaled by DPI and the specified value is always added at both opposing sides.

[window.padding]
x = 9
y = 9

Font

[font]
size = 11.0

[font.bold]
family = "InconsolataGo Nerd Font"
style = "Bold"

[font.bold_italic]
family = "InconsolataGo Nerd Font"
style = "Bold Italic"

[font.italic]
family = "InconsolataGo Nerd Font"
style = "Italic"

[font.normal]
family = "InconsolataGo Nerd Font"
style = "Regular"

Cursor

And all the time, I thought I hate blinking cursor. But what I discovered is that it really helps when i.e. filling passwords with xdotool. Cursor start blinking when typing is done and you know you can hit the enter.

Even better, Alacritty has 5 seconds blinking timeout, so it is much quieter than usual.

[cursor.style]
blinking = "Always"
shape = "Block"

[cursor.vi_mode_style]
blinking = "Always"
shape = "Beam"

Colors

I’m currently using Solarized Dark almost everywhere.

# Base16 Solarized Dark 256 - alacritty color config
# Ethan Schoonover (modified by aramisgithub)
[colors]
draw_bold_text_with_bright_colors = false

[[colors.indexed_colors]]
color = "0xcb4b16"
index = 16

[[colors.indexed_colors]]
color = "0xd33682"
index = 17

[[colors.indexed_colors]]
color = "0x073642"
index = 18

[[colors.indexed_colors]]
color = "0x586e75"
index = 19

[[colors.indexed_colors]]
color = "0x839496"
index = 20

[[colors.indexed_colors]]
color = "0xeee8d5"
index = 21

[colors.bright]
black = "0x657b83"
blue = "0x268bd2"
cyan = "0x2aa198"
green = "0x859900"
magenta = "0x6c71c4"
red = "0xdc322f"
white = "0xfdf6e3"
yellow = "0xb58900"

[colors.cursor]
cursor = "0x93a1a1"
text = "0x002b36"

[colors.normal]
black = "0x002b36"
blue = "0x268bd2"
cyan = "0x2aa198"
green = "0x859900"
magenta = "0x6c71c4"
red = "0xdc322f"
white = "0x93a1a1"
yellow = "0xb58900"

[colors.primary]
background = "0x002b36"
foreground = "0x93a1a1"

Transparency

[window]
opacity = 0.9

Hints

Ok, this is killer feature I missed and really easy to set up.

Terminal hints can be used to find text or hyperlink in the visible part of the terminal and pipe it to other applications.

I’m setting up two hints for now:

Ctrl+Shift+O
hint links and open
Ctrl+Shift+Y
hint links and copy/yank
[hints]
# Keys used for the hint labels.
alphabet = "asdfjkl;gh"

# List with all available hints
#
# Each hint must have any of `regex` or `hyperlinks` field and either an
# `action` or a `command` field. The fields `mouse`, `binding` and
# `post_processing` are optional.
#
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
# highlighted.
#
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
# `regex` matches.
#
# Values for `action`:
#   - Copy
#       Copy the hint's text to the clipboard.
#   - Paste
#       Paste the hint's text to the terminal or search.
#   - Select
#       Select the hint's text.
#   - MoveViModeCursor
#       Move the vi mode cursor to the beginning of the hint.
[[hints.enabled]]
command = "xdg-open"
hyperlinks = true
post_processing = true
regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-�<>\"\\s{-}\\^⟨⟩`]+"

[hints.enabled.binding]
key = "O"
mods = "Control|Shift"

[hints.enabled.mouse]
enabled = true
mods = "None"

[[hints.enabled]]
action = "Copy"
hyperlinks = true
post_processing = true
regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-�<>\"\\s{-}\\^⟨⟩`]+"

[hints.enabled.binding]
key = "Y"
mods = "Control|Shift"

[hints.enabled.mouse]
enabled = true
mods = "None"