Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable ohmyzsh's aliases #9414

Closed
ghost opened this issue Nov 3, 2020 · 10 comments · Fixed by #11550
Closed

Add option to disable ohmyzsh's aliases #9414

ghost opened this issue Nov 3, 2020 · 10 comments · Fixed by #11550
Labels
Feature New feature or request

Comments

@ghost
Copy link

ghost commented Nov 3, 2020

Is your feature request related to a problem? Please describe.
Yes. I don't want aliases i never asked for. When I do alias i see that there are aliases like egrep='egrep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}', which I have no idea about.

Describe the solution you'd like
It would be nice if I could set a variable like OMZ_ALIASES=false, so that i can disable aliases, or a even better solution would be to maintain the list of aliases in a separate file, so that I can comment out the ones if don't want//

Describe alternatives you've considered
I have tried to manually comment out the aliases i don't want by grep-ing, but that is tiresome

Additional context
I am not talking about the git aliases, which are rather helpful. I am talking about the aliases that are sourced even when plugins=()

Related Issues
Unwanted aliases can lead to people wondering what they are doing wrong when they aren't doing anything wrong, and its the alias they never knew they had causing the problem.

@ghost ghost added the Feature New feature or request label Nov 3, 2020
@MrAureliusR
Copy link
Contributor

Are you sure these are from oh-my-zsh, and not from your distributions /etc/profile or similar?

@ghost
Copy link
Author

ghost commented Nov 9, 2020

@MrAureliusR yes i am sure these are from oh-my-zsh, try it yourself
Run alias and you will see "_" aliases as sudo

@jose-bonilla
Copy link

@MrAureliusR yes i am sure these are from oh-my-zsh, try it yourself
Run alias and you will see "_" aliases as sudo

Can you show your list of aliases? Mine isn't showing this.

@cascadingstyletrees
Copy link
Contributor

You can add an unset at the end of your .zshrc, I was having the same issue with fd being overwritten by the common-aliases plugins. So I added:

unset fd to the end of my .zshrc

@cascadingstyletrees
Copy link
Contributor

This is a slightly similar situation as this PR for fd, #9162

@mcornella
Copy link
Member

There's a proposal for a way to turn off aliases in #10644. Please have a look and add your feedback. Thanks!

@daBee
Copy link

daBee commented Oct 3, 2022

I found this conversation because my own aliases such as l and ll are overwritten with omz reload or omz update. There are no plugins that help me find out where these individual definitions are, so I can comment them out.

I also find _ aliased to sudo

@rwmitchell
Copy link
Contributor

I add an unalias above my own that conflict ( usually my own functions vs OMZ aliases) instead of commenting out anything in OMZ as that requires future maintenance.

@mcornella
Copy link
Member

mcornella commented Oct 3, 2022

Another option is to add the aliases after OMZ has been sourced. The aliases you mention in particular are coming from lib/directories.zsh.

_ is coming from lib/misc.zsh

@daBee
Copy link

daBee commented Oct 3, 2022

I found lib/directories.zsh and commented those two out. Ironic there is no way of mapping declarations of various aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
Archived in project
6 participants