Skip to content
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

Advantages over bat? #236

Closed
CarterLi opened this issue Aug 10, 2024 · 6 comments
Closed

Advantages over bat? #236

CarterLi opened this issue Aug 10, 2024 · 6 comments

Comments

@CarterLi
Copy link

I am a bat user and just found this. Should I switch?

@walles
Copy link
Owner

walles commented Aug 10, 2024

You should try and see what you think! Since switching in either direction is super simple, Just Do It™.

That said, since bat is a wrapper around less, you actually have three options here:

  1. Use moar instead of bat
  2. Tell bat to use moar as its pager (export PAGER=moar or set -Ux PAGER moar in fish)
  3. Stay with bat

If you ever search, you should probably go with 1 or 2 since search in less is bad (IMO, that's why I started moar in the first place).

If you're having problems with mouse scrolling you may want to go with 1 or 2 since it can sometimes be tricky to get right in less.

If you switch entirely you'll probably see some differences in syntax highlighting, since moar and bat use different highlighters.

I'm rambling, was any of this helpful?

If you did try it, let me know your reactions!

@CarterLi
Copy link
Author

Found a bug of syntax highlighting

Try #define TEST "//test"

@walles
Copy link
Owner

walles commented Aug 11, 2024

moar is using Chroma for syntax highlighting.

I found what I believe is this issue already reported, and added your test case there:
alecthomas/chroma#953 (comment)

@CarterLi
Copy link
Author

CarterLi commented Aug 11, 2024

The syntax highlighting of moar is really bad.

image

Why is the 1st and 3rd #include are red but 2nd and 4th #include are white?

bat:

image

https://github.com/fastfetch-cli/fastfetch/blob/dev/src/common/sysctl.h

I don't think I want to switch at this time. Thanks.

@CarterLi CarterLi closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2024
@CarterLi
Copy link
Author

moar is using Chroma for syntax highlighting.

Well I don't use Chroma. I use moar.

walles added a commit that referenced this issue Aug 11, 2024
@walles
Copy link
Owner

walles commented Aug 11, 2024

The sucky includes highlighting is fixed now in v1.25.4:

https://github.com/walles/moar/releases/tag/v1.25.4

walles added a commit that referenced this issue Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants