Live data from Hacker News

CLI: Improved

remysharp.com

11–20 of 280 posts

Re: CLI: Improved

#11

> The bat command also allows me to search during output (only if the output is longer than the screen height) using the / key binding (similarly to less searching). You can do this with `less -F `. It will show the file on the screen like `cat` unless it is longer than one screen, then it will go into paging mode and allow search with `/`. Side note, how do you make his nice-looking prompt?

you don't need the -F do you? unless I'm missing something you're saying about less

That makes it exit immediately like cat.

Re: CLI: Improved

#12

Earlier quoted context omitted.

you don't need the -F do you? unless I'm missing something you're saying about less

That makes it exit immediately like cat.

oh. but why would you want to? even for a 1 page file i still want to / most of the time

Re: CLI: Improved

#13
"bat" is not a better version of cat, it's a completely different tool. cat is short for concatenate. If you want to view a file use less, and if you want syntax highlighting etc. then use view (comes with vim).

Re: CLI: Improved

#18

"bat" is not a better version of cat, it's a completely different tool. cat is short for concatenate. If you want to view a file use less, and if you want syntax highlighting etc. then use view (comes with vim).

bat can still be used to concatenate files: https://github.com/sharkdp/bat#file-concatenation

"Whenever bat detects a non-interactive terminal, it will fall back to printing the plain file contents."

Re: CLI: Improved

#19

bat is cool but is there a way to get not to dump everything into my terminal and just page just like less? i wonder if there's a `bless` ?

By default, bat seems to support displaying contents of the file in a pager.

Re: CLI: Improved

#20

"bat" is not a better version of cat, it's a completely different tool. cat is short for concatenate. If you want to view a file use less, and if you want syntax highlighting etc. then use view (comes with vim).

> if you want syntax highlighting etc. then use view

I'd like to recommend pygmentize also for syntax highlighting. Works like cat and supports a lot of languages. But since pygmentize is written in Python, it may not run as fast as bat. (I haven't tried bat though, because pygmentize is fast enough for my daily use cases.)

Post reply on HN