Skip to content

Commit

Permalink
Disable ls alias only during chruby load time
Browse files Browse the repository at this point in the history
Note that `chruby` calls `ls` only during load time, so this is a better
workaround than eb8e022.
  • Loading branch information
FranklinYu committed Oct 7, 2020
1 parent 7656865 commit 0bfe4de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 2 additions & 3 deletions posix-sh/config.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
alias g=git
alias be='bundle exec'
alias ls='ls --color=auto'
alias docker-shell='docker run --rm --interactive --tty --volume "$PWD:/docker"'
alias ping='ping -c 10'
alias pu=pushd po=popd d='dirs -v'

if command -v exa >/dev/null 2>&1
then alias ll='exa --long' la='exa --all' tree='exa --tree'
else alias ll='ls -l --human-readable' la='ls --almost-all'
then alias ls=exa ll='exa --long' la='exa --all' tree='exa --tree'
else alias ls='ls --color=auto' ll='ls -l --human-readable' la='ls --almost-all'
fi

if command -v bat >/dev/null
Expand Down
10 changes: 8 additions & 2 deletions zsh/config.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ source_from_share nvm/nvm.sh

source_maybe ~/.config/zsh/local-config.zsh

source_from_share chruby/chruby.sh
source_from_share chruby/auto.sh
function () {
local ls_alias=$aliases[ls]
unalias ls
source_from_share chruby/chruby.sh
source_from_share chruby/auto.sh
alias ls="$ls_alias"
}

source_from_share zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

unfunction source_from_share source_maybe

1 comment on commit 0bfe4de

@FranklinYu
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also #5.

Please sign in to comment.