如何更改默认的oh-my-zsh命令别名?

huangapple go评论79阅读模式
英文:

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 following in my .zshrc without success:

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

英文:

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

答案1

得分: 1

没有“默认”别名,但别名可以叠加。如果你有一个别名

alias l='ls -lahF'

和一个别名

alias ls=exa

那么 l 将会扩展为 exa -lahF

英文:

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.

huangapple
  • 本文由 发表于 2020年1月6日 21:53:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/59613347.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定