walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
675 stars 19 forks source link

Advantages over bat? #236

Closed CarterLi closed 3 months ago

CarterLi commented 3 months ago

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

walles commented 3 months ago

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 commented 3 months ago

Found a bug of syntax highlighting

Try #define TEST "//test"

walles commented 3 months ago

moar is using Chroma for syntax highlighting.

I found what I believe is this issue already reported, and added your test case there: https://github.com/alecthomas/chroma/issues/953#issuecomment-2282661521

CarterLi commented 3 months ago

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 commented 3 months ago

moar is using Chroma for syntax highlighting.

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

walles commented 3 months ago

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

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