英文:
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论