Hacker News new | ask | show | jobs
by alien1993 2523 days ago
I obtain a similar thing by adding this snippet to my .zshrc[0]. Notice I use bat[1] and exa[2] as alternative to cat and ls.

This is the result: https://gfycat.com/brokengiantcockerspaniel

[0]: https://github.com/silvanocerza/dotfiles/blob/master/zsh/zsh...

[1]: https://github.com/sharkdp/bat

[2]: https://github.com/ogham/exa

3 comments

This is really cool. I didn't realize --preview could take something as complex as this.
Nice tips!! bat(1) is fantastic, wow. exa(1) seems neat, but the inconsiderate--and likely deliberate--lack of compatibility with ls(1) flags means I will never use it any time soon... I have decades' worth of aliases, scripts, and reflexive muscle-memory using GNU ls, so it's not even close to being worth the pain of changing.
It's not like your going to delete `ls` - you can have both?

I have a `ll` alias which is use for 80% of my "what's in this folder" ls use - I just changed this alias (and a couple of others) to use exa. I left ls alone: I didn't alias ls to exa.

It's been a good QoL improvement for me, at ~zero cost.

You're right. I can do that. I didn't want to risk starting a flame war by admitting I have twelve main `ls' aliases (twelve unique argv incantations), and that I keep them portable across platforms. LOL. I started doing this about 20 yrs ago. Many times, I will inject them with a zsh or keyboard macro, since I type on a custom keymap on a programmable keyboard. So I didn't want yet another conditional branch in my configuration management. ;) Not sure whether "special" or just demented...
You could try lsd(https://github.com/Peltoche/lsd) instead of exa.
The fzf.vim[0] plugin offers similar capability in vim to give you this: https://asciinema.org/a/171913

[0]: https://github.com/junegunn/fzf.vim