-
Notifications
You must be signed in to change notification settings - Fork 382
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
Config file and custom themes similar to bat #19
Comments
Hi, thanks for the feedback! Regarding a config file, For custom themes, could you expand on what you'd like
|
Certainly! I accidentally pressed enter when composing this and submitted it prematulrely. In terms of config… you're right that gitconfig takes that role, and I think we'd be fine without a separate config file. It is nice that In terms of custom themes, the main issue is having to recompile the binary every time. It'd be nice if they could be loaded dynamically from e.g. |
I added Nord.mtTheme to a local BTW: I think one does not need to clone |
@mgred You need to recompile locally (e.g. I believe that I expect this process could be made slicker, perhaps by continuing to copy exactly what |
I've updated the README to make this a bit clearer, but I think @clarfon is right:
I'd also be happy for |
@clarfon I'm not quite seeing the distinction here. We can enter command-line options ahead of time in
bat's config file would literally just be another list of command line arguments. If we supported both, it would be pretty confusing, because people would be in doubt which had precedence, right? |
So to be explicit, I agree with @clarfon and propose leaving this issue open to have delta use bat's themes and languages workflow including dynamic loading at runtime. |
Thanks @dandavison! That was doing the trick. I can no use the Theme as expected 🙏
Sounds great 👍 I would then also consider doing the same for Thanks for your help and explanation. |
Closed by #76. The suggestion of a config file has not been implemented. One argument for a config file is that delta can be used with standard unified diff output, in which case the git (or mercurial) config files will not be consulted. This use case could however be addressed by a shell alias setting the desired delta options. Since most usage is with git, I think it makes sense not to introduce a second config file but rather to continue to use the git config file as delta's config file. |
The README still says
Could that be updated? |
@jamescostian Thank you! Done: #84 |
Given that you need to specify
|
@Nemo157 good point. Just throwing out another possibility: for people who are happy creating shell scripts and staying on top of their $PATH, you could create an executable shell script in a location on your $PATH (so for me I would put the shell script at #!/bin/bash
exec delta --commit-style box --commit-color="red" --theme 'GitHub' "$@" Then,
I'm not ruling it out but the downside with a config file is that then we have to have rules regarding the precedence of the config file, the ~/.gitconfig, and any relevant env vars. |
@dandavison that sounds like a great workaround, thanks! |
I would really like to see delta add support for a config file anyway. The problem with adding my own script is I now need to add another entry to my PATH, as While I am a fan of reading delta config from gitconfig, I do recognize that this doesn't make sense when piping output to delta directly, but I think having a Edit: Ok I just realized I can of course set git config to look at an absolute path instead of relying on PATH for lookup. But that makes my config less flexible as now I have to ensure the script exists at that path on all machines that I copy my config to. |
FWIW another issue with "wrap delta with your own script" is delta doesn't like it when you pass flags multiple times, so e.g. if my script provides |
@lilyball I 100% agree. I was planning on coming back to this ticket and saying thanks to @clarfon for originally raising this and that I think you're right that Delta needs a better config file solution. The good news is that the next release of delta (coming soon, next week I hope) is going to fully support a lot of new configuration possibilities via a |
Would be very nice to have.
The text was updated successfully, but these errors were encountered: