Rust ... slowly but surely, all applications are being rewritten in Rust.
My next few tips will cover a few of these :)
Exa
Exa is an ls
replacement written in Rust. As they say in their README
:
with more features and better defaults
What does it look like?
Pretty shiny, eh?
Things worth noting:
- Colours that distinguish directories, files, and executable files
- Colours for permissions, owners, and size of file
- Git status of each file in long output
Trees Everywhere
When working with code, it can be pretty nice to get a tree
style look at the repository. Exa surpasses expectations here too.
First, here are a few aliases I have configured:
# ls
TREE_IGNORE="cache|log|logs|node_modules|vendor"
alias ls=' exa --group-directories-first'
alias la=' ls -a'
alias ll=' ls --git -l'
alias lt=' ls --tree -D -L 2 -I ${TREE_IGNORE}'
alias ltt=' ls --tree -D -L 3 -I ${TREE_IGNORE}'
alias lttt=' ls --tree -D -L 4 -I ${TREE_IGNORE}'
alias ltttt=' ls --tree -D -L 5 -I ${TREE_IGNORE}'
Let me explain:
-
--tree
- Enables Tree display -
-D
- Show directories only (Useful for large trees) -
-L n
- How many levels deep to display -
-I ${TREE_IGNORE}
- This omits/hides common vendor directories, as defined in the variable above the aliases
Here's a short asciinema
of me using the lt
, ltt
, and lttt
aliases:
Top comments (2)
I used
exa
for more than a year but recently I decided to ditch it in favor ofls
with.dircolors
. I've lost some colors, like in the permission columns, butls
is much more reliable thanexa
.It happened that
exa
would sometimes not print a file even if it was present, running it just a second later would show it, kinda impossible to reproduce, probably a concurrency issue. That was pretty annoying but the tipping point for me was when it always crashed on a specific directory,ls
was obviously working correctly.I think this kind of rewrites in Rust will gain more popularity when they'll start being reliable like their original counterpart.
I made this wrapper script so that you can use the same switches as ls, so you don't need to learn any new ones.
gist.github.com/eggbean/74db77c4f6...