walles/moar

Advantages over bat?

CarterLi opened this issue · 6 comments

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

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!

Found a bug of syntax highlighting

Try #define TEST "//test"

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)

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.

moar is using Chroma for syntax highlighting.

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

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

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