Skip to content

Instantly share code, notes, and snippets.

@xeger
Last active January 25, 2023 12:24
Show Gist options
  • Select an option

  • Save xeger/ceca893a4490fd87d3d4c69d8a481c30 to your computer and use it in GitHub Desktop.

Select an option

Save xeger/ceca893a4490fd87d3d4c69d8a481c30 to your computer and use it in GitHub Desktop.
Custom themes for IRB::Color
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
@hakunin

hakunin commented Jan 25, 2023

Copy link
Copy Markdown

Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment