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
🚀 Provide a map-syntax feature, like bat does #326
Comments
Hi @ahmedelgabri, thanks for this, but delta doesn't use bat for syntax highlighting. So, currently at least, delta doesn't look at the bat config file. So, perhaps this is best turned into a feature request for |
If delta honors |
Unless you plan not to use bat, I don’t see why you shouldn’t pick up it’s config. Yes it will couple the projects together but bat can be used as a library already so it’s not like you are going to be tied to an external app. It can be a direct dependency of the project which you can swap later if you want. |
I found this confusing too, when trying to work out how to map my +1 for some form of |
I agree with this, the readme mentions over and over how delta supports everything bat does so I just assumed that it uses bat as a dependency and the config would work. In particular I'm also interested in having the equivalent of |
Thanks for the design input here @ahmedelgabri @nickspoons @SuperCuber. On the one hand the way the documentation has mentioned bat has caused some confusion, and there is probably no need for delta to support cc @MarcoIeni @Kr1ss-XD any thoughts here? ref #116 "Make use of bat as a library" |
On the one hand I think it would be nice if delta could parse the bat configuration file and make use of the settings in it, to have a single place where syntax- and color-schemes would be defined. Nonetheless, I do find it really useful that I can define different settings for a) standalone use of bat, and Hence my suggestion would be to either
If it comes to one of these two alternatives, I'd prefer the first one. It would cause less of a change compared to the current status. |
I definitely agree we need to make map-syntax functionality available for delta: the situation with the vim config files sounds really annoying :/ The syntax of the bat config file is simply strings representing bat command line options. So one option would be to undertake to read that but only respect certain entries such as I'm honestly not sure yet what's best here, so do keep the opinions coming! What we're talking about is configuring the usage of the binary sublime syntax and theme definitions that both delta and bat use. Other than
@Kr1ss-XD I'm guessing you wouldn't want to map syntax differently in bat vs delta, right? |
No, I only find different color themes convenient. Sorry if I wasn't precise. |
cc @Ryuta69 who's also been thinking about ways to make command line configuration and on-the-fly config changes more convenient.
Not at all; very helpful. |
For me, what I only want from delta to respect from bat is only the syntax mapping, the rest doesn't make sense to support (at least for me) I don't want to configure two places/tools to do the same thing if one of them consumes the other already. |
I am not an heavy delta user, so I don't have any particular opinion about this, but I will keep this discussion in mind while trying to solve #116 |
I would love to see the
Now I see "Rnw" under LaTeX when I run |
I'd be fine with different options in delta vs bat, and with copying things from my bat config to my delta config. Ideally the argument names would be the same so I could just copy the Pulling some options from the bat config seems possible, but would also be confusing if only some options were respected. |
I agree with @gibfahn. I don't care if I have to maintain two separate sets of configuration (I already do), I just want the option to exist in delta so I can make use of it. |
I would also like some way to customize the syntax detection, based on the file extension. For example, I'd want As an aside, delta would be even more amazing if it could use the
then delta would recognize those files as Fortran without me having to configure delta itself. One could even think of a further fall back to GitHub's and GitLab's special attributes for syntax highlighting: |
Those sound like good suggestions @phil-blain. In the absence of any actual work on this I just want to point out that it is possible to work around this by
If you have a recent bat version, then this requires delta >= 0.12.1. |
Thanks a lot for that suggestion, that's really great! |
As far as I understand,
delta
usesbat
for its syntax highlighting, etc… Andbat
supports having a config file (bat --config-file /path/to/file
or by settingBAT_CONFIG_PATH
), I'm interested in the second caseBAT_CONFIG_PATH
.In this file you can have some file mapping like this for example:
But it seems like this is not being picked up by the
bat
version used bydelta
The text was updated successfully, but these errors were encountered: