Skip to main content
  1. Posts/
  2. The Solo Stack/
  3. Dotfiles/

Making eza Your Default

Dotfiles - This article is part of a series.
Part 11: This Article

In the previous post, I wrapped up the installation story. We now have four strategies for getting software onto a fresh machine. But installing tools is only half the job — they need configuring. And eza is the perfect place to start, because it’s a drop-in replacement for something I use hundreds of times a day: ls.

Why Replace ls?
#

The standard ls does its job, but it hasn’t changed much in decades. eza brings color-coded file types, git status integration, and — with a Nerd Font installed — file type icons right in your terminal. Once you’ve seen a directory listing with icons and git markers, plain ls feels like reading a wall of text.

But eza only shines if it’s actually the command you reach for. Typing eza instead of ls every time isn’t realistic — muscle memory runs too deep. The fix is aliases.

The Aliases I Want
#

At my company, I had a set of shell aliases that replaced the standard listing commands. I want to recreate that setup, adapted for eza:

  • ls — replaced by eza with icons and color
  • la — list all files, including hidden ones
  • ll — removed (too easy to confuse with the others)
  • lla — long listing with all files, git status, and header
  • lls — tree view for quick directory overviews

Here’s what that looks like in practice:

alias ls='eza --icons=always'
alias la='eza -a --icons=always'
alias lla='eza -la --icons=always --git --header'
alias lls='eza -T --icons=always'

The --icons=always flag requires a Nerd Font in your terminal. I’m using Alacritty with a Nerd Font installed, so this works out of the box.

Adding the Aliases to .zshrc via chezmoi
#

Back in the first post, we added a minimal .zshrc to chezmoi. Now it’s time to edit it. Since chezmoi manages the file, I don’t edit ~/.zshrc directly — I edit the source:

chezmoi edit ~/.zshrc

This opens the source file in chezmoi’s directory. I add the aliases at the end:

# eza aliases
alias ls='eza --icons=always'
alias la='eza -a --icons=always'
alias lla='eza -la --icons=always --git --header'
alias lls='eza -T --icons=always'

Then I apply the change:

chezmoi apply

That’s it. The updated .zshrc is now in place. To verify:

source ~/.zshrc
ls

If eza is installed and a Nerd Font is active, you’ll see colorized output with file type icons.

Seeing the Difference
#

To appreciate what eza brings to the table, here’s a side-by-side comparison. First, the classic approach using tree:

tree -a -L 2 -u -g -h -D -C
Output of tree command showing directory structure with ownership, size, and date information
tree -a -L 2 -u -g -h -D -C — the classic way to inspect a directory.

And the same directory with eza:

eza -T -L 2 -la --icons=always --git
Output of eza command showing directory structure with icons, git status, and color coding
eza -T -L 2 -la –icons=always –git — same info, but with icons, git status, and color.

The eza version adds git status markers, file type icons, and consistent color coding — all without installing a separate tool for tree views, since eza handles trees natively with -T.

The Aliases in Action
#

Here’s what it looks like when all four aliases are in use — ls, la, lla, and lls — in a single terminal session:

Terminal showing ls, la, lla, and lls aliases powered by eza with icons, git status, and tree view
All four aliases in action — from a quick ls to a full tree view with lls.

Committing the Change
#

To push the changes to the dotfiles repo:

chezmoi cd
git add -A && git commit -m "add eza aliases to zshrc" && git push

What We’ve Achieved So Far
#

After chezmoi init --apply, a fresh machine now has:

  • zsh installed and set as default shell
  • The correct version of age, installed from source
  • SSH keys decrypted and in place
  • Git identity configured for the dotfiles repo
  • SSH key linked to git, remote switched to SSH
  • Ansible installed and used to manage software packages
  • tmux installed via Ansible
  • eza installed from an external apt repository via Ansible
  • Onchange script that watches the entire ansible/ directory for changes
  • Sudo password support for non-root environments
  • fzf installed from a GitHub binary release via Ansible
  • eza aliases configured in .zshrc — ls, la, lla, and lls

What’s Next
#

eza is configured, but it’s just the first tool. tmux and fzf are installed but still running with defaults. Next up: giving tmux a configuration that makes it actually pleasant to use.

Marcus Knuth
Author
Marcus Knuth
Dotfiles - This article is part of a series.
Part 11: This Article

Related

Getting Started with Dotfile Management

·1225 words·6 mins
Getting Started with Dotfile Management # Up until now, I’ve mostly been working with GUI-driven IDEs on Windows. I wrote about why I’d like to shift to the terminal — the short version is that a portable, keyboard-driven workflow matters when you’re building solo. But alongside that shift, something else has been happening. Since Docker entered my daily work, I’ve been spending more and more time on Linux again — something I hadn’t done seriously since studying computer science. Linux stepped back into my life gradually, and for a long time I just used it without thinking much about it. I never cared about the fundamentals.

When Onchange Doesn't

In the previous post, I extended the Ansible playbook to install eza from an external apt repository. Everything worked in the container. Time to run it on my actual WSL2 machine. chezmoi update Nothing happened. No Ansible output. No errors. The playbook didn’t run at all.

When apt Doesn't Have What You Need

·1135 words·6 mins
In the previous post, we wired Ansible into chezmoi and installed tmux as our first package. One playbook, one task, one apt install. Clean and simple. Now I want to add eza — a modern replacement for ls with color-coded output, git awareness, and sensible defaults. It’s one of those tools that, once you’ve used it, makes plain ls feel like staring at a wall of text.