3 ms·
One of the biggest upgrades from using fish is syntax highlighting / autocompletion. You can get fish-style syntax highlighting and autocomplete in zsh (which h
by IggleSniggle 6y ago
One of the biggest upgrades from using fish is syntax highlighting / autocompletion. You can get fish-style syntax highlighting and autocomplete in zsh (which has the advantage of being more interoperable with bash generally):
[zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting)
[zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions)
Poster mentioned "modern alternatives exist" with good colorization options. Some of my favorite colorized feature-rich alternatives:
ls -> [exa](https://github.com/ogham/exa https://github.com/ogham/exa)
cat -> [bat](https://github.com/sharkdp/bat https://github.com/sharkdp/bat)
du -> [ncdu](https://dev.yorhel.nl/ncdu https://dev.yorhel.nl/ncdu)
diff -> [delta](https://github.com/dandavison/delta https://github.com/dandavison/delta)
In combination with all of the above, [fzf](https://github.com/junegunn/fzf https://github.com/junegunn/fzf) suddenly becomes a syntax-highlighter preview-pane via leveraging bat (or delta, as the case may be).
- danyspin97 6y agoPoster here! ble.sh gives syntax highlighting for bash just like fish and zsh. I personally don't like zsh because it seems over engineered and fish have some design problems (I don't think they have yet fixed them). The feature-rich alternatives you mentioned are exactly what I was thinking about (and using daily!).
- IggleSniggle 6y agoThere are a few things about zsh that "feel better" than bash (especially arrays), but given the ubiquity of bash, if I can get the same general quality-of-life upgrades that I experience from the zsh community add-ons, I may need to give ble.sh a go. Edit: I gave ble.sh a try, and it is super-cool-magic, but does feel slow with quite noticeable input lag.
- Morgangeek 6y agoI've also aliased cat to bat but it causes me issues when I redirect the output of cat (bat) without \cat to a file as then the file contains color codes that are not expected by other users and tools and cause some tools to not behave correctly,while the issue is invisible to me (unless reading the generated file with \cat)
- IggleSniggle 6y agobat should not be doing that. It should perform exactly like cat when piped or redirected. At least it does for me, even if the text is colorized in a tty. Perhaps an issue with your pager settings? Dunno.
- diego898 6y agoThanks for the links! Could you say a bit more about how you use/configure fzf to work in combination with bat and delta?
- IggleSniggle 6y agofzf has a preview pane option. Typical OOTB usage is to use this to cat the output of the currently hovered item in your list. But fzf can fuzzy-find on any list, not just file lists, and use the preview pane to display anything based on your selected inputs. One very nice demonstration of this is [git-fuzzy](https://github.com/bigH/git-fuzzy https://github.com/bigH/git-fuzzy) The hardest part about leveraging the power of fzf is getting input into your --preview argument in the middle of some piped process. But that's also where it's true power becomes fully evident. awk users have long had similar powers. And indeed you might find awk useful for reorganizing record separators in a pipe to fzf. But fzf is brilliant because it "just works" for 90% of cases. I think we're probably going to see people sharing some pretty incredible workflows with fzf in the next few years. Something about being able to stick it in the middle of a Unix pipe just makes it really really special; it's compose-able!