Last active
January 25, 2023 12:24
-
-
Save xeger/ceca893a4490fd87d3d4c69d8a481c30 to your computer and use it in GitHub Desktop.
Custom themes for IRB::Color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
c = IRB::Color | |
token_seq_exprs = IRB::Color::const_get(:TOKEN_SEQ_EXPRS) | |
# TODO: italics; see https://github.com/microsoft/vscode/issues/49236 | |
# TODO: how to customize method names (cyan or bold cyan I think?) | |
# TODO: what about TOKEN_SEQ_KEYWORDS? do we care? | |
one_dark = { | |
on_comment: [c::CLEAR], # needs italics | |
on_const: [c::YELLOW, c::BOLD], | |
on_label: [c::YELLOW], | |
on_kw: [c::MAGENTA], | |
on_tstring_beg: [c::GREEN, c::BOLD], | |
on_tstring_content: [c::GREEN], | |
on_tstring_end: [c::GREEN, c::BOLD], | |
} | |
one_dark.each_pair do |token, theme_colors| | |
if stdconfig = token_seq_exprs[token] | |
stdconfig[0] = theme_colors | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save this file as
~/.irbrc
and edit to suit your liking.one_dark
is the "One Dark Pro" theme, originally from Atom editor, which I also use with Mac OS Terminal and with Visual Studio Code.(I don't care so much about the theme colors -- I just use it because it's available for all of the tools on my system!)