How to adjust pry colors

给你一囗甜甜゛ 提交于 2019-12-03 03:00:40

Pry uses CodeRay for coloring, so you can put the following in your .pryrc file:

CodeRay.scan("example", :ruby).term # just to load necessary files

TERM_TOKEN_COLORS = {
    :symbol => '1;31' # will make symbols bolded and light red on my terminal
}

module CodeRay
    module Encoders
        class Term < Encoder
            # override old colors
            TERM_TOKEN_COLORS.each_pair do |key, value|
                TOKEN_COLORS[key] = value
            end
        end
    end
end

You can see here all values that can be customized (not sure which one exactly is the one you mentioned, but shouldn't be hard to track down): https://github.com/rubychan/coderay/blob/master/lib/coderay/encoders/terminal.rb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!