Search code examples
aliaszshoh-my-zsh

How can I change a default oh-my-zsh command alias?


I would like to use exa (github) as a replacement for the default ls. I have gotten used to typing ll, l or ls and would like to alias exa accordingly.

But when trying to override the alias in the .zshrc zsh default back to the usual ls upon reloading and ignores the override.

Tried the follwing in my .zshrc'without sucess:

alias ls="exa -lahF"
alias l="exa -lahF"
alias ll="exa -lahF"

Is it possible to change the default alias and if so, how?

FIXED: Define aliases in .zshrc after source $ZSH/oh-my-zsh.sh


Solution

  • There's no "default" alias, but aliases stack. If you have an alias

    alias l='ls -lahF'
    

    and an alias

    alias ls=exa
    

    Then l will expand to exa -lahF.