REPL demo: add nanorctheme.template #761
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Nanorc theme system helps to keep colors uniform across different languages and also to keep the definitions clear and maintainable. The system allows highlight rules in nanorc files to be specified in terms of token type names or mixins, instead of hard-coded colors.
In REPL demo the theme system has been extended to define highlight rules also for
COLORS
variables (HELP_COLORS
,LS_COLORS
, etc) andlineReader
'sCOMPLETION_STYLE
s. Extended theme system requires that CLI app supportsMap
type console variables. Below is shown all relevant console variables needed by the theme system. Console optionNANORC_THEME
map is created when executing the builtins command:highlighter --refresh
orhighlighter --switch=<new-theme>
. Thehighlighter
command will refresh alsolineReader
'sCOMPLETION_STYLE
s and allsyntaxHighlighter
s used by REPL demo.You can define your nanorc theme using 16 colors and switch between different color themes by changing your terminal 16 colors palette. Available themes and installation instructions see for example Gogh, iTerm2-Color-Schemes and microsoft/ColorTool.
If your terminal color palette is not easily replaceable you can also use hard-coded color definitions in your nanorc theme file. Nanorc theme with hard-coded color definitions can be created using
nanorctheme.template
,apply-colors.sh
and Gogh install like:Linux: