-
Notifications
You must be signed in to change notification settings - Fork 4
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
bat syntax support does not match vim #40
Comments
Hello, thank you for this bug report and sorry that I was silent for so long. Currently life overwhelms me. Honestly, I'd really like to get rid of As for now I like your suggestion, it really seems to be the best solution possible. Just no time/energy to implement it. But I'll definitely return to this in the future! |
I'd like to propose a solution that does not involve
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
light = false # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
[merge]
conflictstyle = diff3
[diff]
colorMoved = default
[pager]
log = delta | page -WC -q 90000 -z 90000
diff = delta | page -WC -q 90000 -z 90000
export DELTA_PAGER="less -R"
export PAGER="page -WC -q 90000 -z 90000" With the above, I have By the way, I came up with a way to have export MANPAGER="sh -c 'col -bx | bat -l man -p --color=always | page'" This is working well for me so far and if I want to switch to I also created an alias alias m="func() { local PROGRAM=$(echo '$@[-1]'); local SECTION=$(echo '${@[-2]:+($@[-2])}'); local OPTIONS=$(echo '${@:1:$# -2}'); page $(echo '$OPTIONS -W man://$PROGRAM$SECTION'); }; func" I hope at least some of the above will be useful. If you can think of a better way to do any of the above, I'm open to suggestions :) |
Problem
I set up page as my git pager:
Though it worked, I was confused about the warning, not knowing what it was or that it was a dependency that needed to be installed.
After looking through the source, I tried installing it:
and now there's no output at all! One can't always assume that bat language names will match git filetypes.
Resolution
There appears to be no way to configure this behaviour. I could've set
PAGE_LOG=error
to silence all warnings, but there's no direct way to turn the bat fallback off. I also would be happy to runbat
if the--language
argument were omitted. I'd suggest:-t
) and bat's language (--bat-language
?-T
?) separately-T
defaults to-t
's value, there should be a way to clear it with-T auto
or somethingstdin
, preferbat --file-name
argument instead ofbat --language
- this code seems incorrect, the extension is not a language and the filename should be passed instead if it is available.(bat uses the filename to auto-detect the language, but unlike
--language
, it will not panic if it does not recognize it)-T none
for example.So
page -O -t pager -T auto
would usebat
, whilepage -O -t rust -T none
wouldcat
insteadThe text was updated successfully, but these errors were encountered: