Bat v0.26.0
61–70 of 78 posts
Re: Bat v0.26.0
#62bat is one of the few "new wave" tools that I install without hesitation, with no worries about stability issues or silent downsides. It has great defaults that make it feel like it always does the right thing for the context, just an unambiguous enhancement to my terminal experience.
I have these aliases, which are useful when piping output to them:
alias bd='bat -p -l diff'
alias bh='bat -p -l help'
alias bi='bat -p -l ini'
alias bj='bat -p -l json'
alias bl='bat -p -l log'
alias bm='bat -p -l man'
alias by='bat -p -l yml'Re: Bat v0.26.0
#63The guy's brilliant. Check out his other projects too: https://github.com/sharkdp?tab=repositories
https://github.com/sharkdp?tab=repositories&q=&type=source&l...
Re: Bat v0.26.0
#64Earlier quoted context omitted.
To be 100% fair, Bat only acts this way when used in an interactive environment. As far as I know, in non-interactive cases (a la shell scripting) it falls back to normal cat behaviour
That's interesting! How did you know?
> Whenever bat detects a non-interactive terminal (i.e. when you pipe into another process or into a file), bat will act as a drop-in replacement for cat and fall back to printing the plain file contents
which was good enough for me personally, but I also have seen anecdotal evidence of people running `alias cat=bat` with a bunch of your usual bash piping work without any issues
Re: Bat v0.26.0
#65Re: Bat v0.26.0
#66Earlier quoted context omitted.
Along with bat, these are my main ones that I install always: fd, a better find: https://github.com/sharkdp/fd ripgrep (rg) a modern grep: https://github.com/BurntSushi/ripgrep eza for ls replacement: https://github.com/eza-community/eza duf is a cleaner df: https://github.com/muesli/duf dust for du: https://github.com/bootandy/dust Also fish + starship + yazi + helix, all of which mostly work perfectly with the defa…
I stopped using eza and lsd in favor of aliasing nushell's ls command. I guess it's not worth the entire dependency of nushell if you don't see yourself ever dabbling with it in other ways (you should it's sick). Also I'd add to your list zoxide I've aliased cat to bat, cd to zoxide, and ls to nushell ls with zero issues.
Re: Bat v0.26.0
#67bat is one of the few "new wave" tools that I install without hesitation, with no worries about stability issues or silent downsides. It has great defaults that make it feel like it always does the right thing for the context, just an unambiguous enhancement to my terminal experience.
I probably have a bunch of such tools installed on my main machine. The problem is you actually need to remember to use them, and then maybe their command line switches to get the desired output. Whereas cat/less/git/vim are muscle memory. Not to mention that you first need to get over the hum of installing them in your system, likely needing to grab the latest Go/Rust/Zig toolchain along the way. So while I admire t…
Re: Bat v0.26.0
#68The `--pager=builtin` change is interesting; first time I've heard of minus. > Traditional pagers like more or less weren't made for integrating into other applications. They were meant to be standalone binaries that are executed directly by users. However most applications don't adhere to this and exploit these pagers' functionality by calling them as external programs and passing the data through the standard input…
Do One Thing*†‡ And Do It Well⹋ * Parsing text formats counts as zero things † UX counts as two things ‡ APIs that do multiple operations that people might want to split, with no individual APIs for the parts, count as doing one thing ⹋ Something that relies on cooperation from every other process on the system but has no way to enforce it counts as done well Nobody bothers with this argument when the library is for,…
Pagers are practically the worst thing to make this argument about, because they mesh perfectly with the strings-only nature of Unix. They take a string and allow the user to navigate through it. They only need to be fast at human-recognizable speeds, there's little reason for them to be highly concurrent, and there's a lot of value in allowing the user to choose which pager they want they to use.
More broadly, there's also value in composable tools because users can use the one they're familiar with. I can learn how jq works and use it with anything that outputs JSON, rather than having to learn the syntax of 18 different libraries various app developers have chosen for querying JSON. I can pipe whatever I want into 'more' instead of having to learn the keybinds for each of the 5 popular paging libraries.
It's not perfect, but I do think it's better than the embedded alternative for a lot of things.
Re: Bat v0.26.0
#69Earlier quoted context omitted.
Having to pipe to a pager - to follow the unix philosophy - means: - extra typing each time - the pager receives static output. There is no interactivity... Sure, most pagers can search. But there is no way to have a table with adjustable columns, or toggle word wrap or line numbers etc. I feel that for a tool like bat, it is better to have it built-in and not follow the composable philosophy because it is just so mu…
The `less` command can toggle line numbers (`-N`, either as a command line argument, or while running it interactively) and toggle line wrapping (`-S`, again either way). It can also receive streamed output with `+F`, making it a viable alternative to `tail -f`. (I'm not sure if what you meant by static output is that it all has to be available before the command can read it.) It can't adjust the columns in a table,…
Re: Bat v0.26.0
#70bat is one of the few "new wave" tools that I install without hesitation, with no worries about stability issues or silent downsides. It has great defaults that make it feel like it always does the right thing for the context, just an unambiguous enhancement to my terminal experience.
Agreed. I use this program all day, every day. Viewing a file without it now is just painful. :-) I have these aliases, which are useful when piping output to them: alias bd='bat -p -l diff' alias bh='bat -p -l help' alias bi='bat -p -l ini' alias bj='bat -p -l json' alias bl='bat -p -l log' alias bm='bat -p -l man' alias by='bat -p -l yml'
alias bat='rview'
rview from vim, OFC.Problem solved, you don't overwrite the files, you get all the vim options and a much better syntax highlighting.
Oh, and, as a plus, you gain xxd, which can be useful in tons of contexts.