-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make colors configurable #90
Comments
I have nothing against this feature, but would this be an environment variable or a command line parameter or config file or what? |
No hard preferences here. |
Just started playing with ag after reading about it on HN today. I'd like to customize the color too. Perhaps something simple like: --colors-path "1;32" An AG_OPTIONS environment variable (similar to GREP_OPTIONS) would be appreciated too, naturally. I might try to put together a pull request, if I can resuscitate my rusty C skills. :) Another (minor) suggestion - perhaps you could update the PPA? I was getting ready to file some bugs related to .gitignore, but they seem to be fixed. Thanks for creating this! |
I'm not a fan of AG_OPTIONS. Bash aliases solve the same problem, and they work with any program. I've deleted my PPA. I'm done dealing with debian/rules, and it's better to have no PPA than an outdated one. If someone wants to maintain their own PPA, I'll link to it in the README. I'll add support for color customization later today. |
Now I feel bad! Was maintaining the PPA a burden? I don't know what's involved, really. As an aside, an environment variable can be advantageous vs. an alias if you end up running searches within tools like emacs. No biggie though. I use a ton of aliases too. I made this change today to preview ag with spiffy new colors: const char *colors_path = "\e[0;35m"; Can't wait to check out the new flags. Thanks! |
Good point about running from emacs. You've convinced me. Now I'm not against an AG_OPTIONS. I tried writing the feature a while ago, but gave up. It looked simple initially, but I couldn't find a simple way to parse a string into a format read by getopt_long. As long as the implementation isn't a crazy huge/complicated pull request, I'm fine with merging it. I doubt I'll ever write it myself. |
Ok take a look at master now. You can configure colors like this:
|
This is great, works perfectly! Here's what I'm using for my solarized shell: alias ag="ag --color-path 35 --color-match '1;35' --color-line-number 32" I think the trick with getopt_long would be to parse the env variable into an array, then prepend to argc/argv. I'll try to take a crack at it if I get a chance. Maybe I can dust off valgrind too. I don't trust myself. Thanks for making the change! |
Cool. I'll close this issue then. |
No description provided.
The text was updated successfully, but these errors were encountered: