ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

Add option to disable all aliases #470

Open klimadavid opened 10 months ago

klimadavid commented 10 months ago

I disabled all aliases in the configuration with aliases=(). 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. How can I disable these aliases?

It would be nice if I could set a variable like OMB_ALIASES=false, so that i can disable aliases.

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.

akinomyoga commented 10 months ago

Use

OMB_DEFAULT_ALIASES=disable
klimadavid commented 10 months ago

Unfortunately it does not work for me and I dont know why:

 david  ~  grep ALIAS .bashrc
OMB_DEFAULT_ALIASES="disable"
 david  ~  grep aliases= .bashrc
# Example format: aliases=(vagrant composer git-avh)
aliases=()
 david  ~  alias 
alias gbda='command git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gignored='command git ls-files -v | grep "^[[:lower:]]"'
alias gunwip='command git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
...

It looks like the aliases that remain come from the git plugin.

akinomyoga commented 10 months ago

It looks like the aliases that remain come from the git plugin.

Yes. If you don't want these aliases, you also need to remove the git plugin from the plugins array.

klimadavid commented 10 months ago

I need the git plugin, but I don't want aliases... :(

akinomyoga commented 10 months ago

In such a case, you can copy the git plugin to the custom directory and edit it. The way to copy and edit a plugin is described in "Customization of Plugins and Themes" (README).