-
Notifications
You must be signed in to change notification settings - Fork 870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add syntax highlighting using pygments. #20
Conversation
Nice. I like. |
I like the idea of colorization but I think it may need to be more specific than the default guess_lexer. I tried the following commands: $ howdoi format string bash Of all the commands only two were colored, and of those the only symbols that were selected for color were "for", "${", and "$}" You might want to take a look at this comment and try to implement some of the suggestions. |
It now finds a lexer based on the first argument/tag matching a pygments lexer. Duplicate: #24 |
Thanks for this request. I'm evaluating it and #24 and will provide feedback once I have tested both. |
After playing with this commit and #24 I prefer this version. The highlighting is nice but I find that it can sometimes be too intrusive. What do you think about colorization being optional through a flag (-c / --color)? If you want to permanently enable color you would include the following alias:
|
I merged your master branch and updated the code with a My favorite setting is with
I feel it's often preferable to have the full (colorized) answer, where so much can be learned... But I let you choose what the default behavior should be. |
Thanks @pierroweb! I'll take a final look this week. |
It looks nicer with some color highlighting, which comes for free using pygments and its guess_lexer smart function.
The few lines of code come from http://pygments.org/docs/quickstart/
(nice idea btw!)