Sort some aliases

This commit is contained in:
crater2150 2021-02-06 13:30:20 +01:00
parent 51357f7e47
commit ed286f1d0a
3 changed files with 17 additions and 18 deletions

View file

@ -201,7 +201,6 @@ svn() {
} }
alias gitv='vim "$(git rev-parse --git-dir)/index" -c "Gitv --all" -c tabonly' alias gitv='vim "$(git rev-parse --git-dir)/index" -c "Gitv --all" -c tabonly'
alias ipy=ipython3
#}}} #}}}

View file

@ -1,20 +1,11 @@
#!/bin/zsh #!/bin/zsh
hashafter () { grep -q "void" /etc/os-release || return
local fname=$1
eval "
function $fname() {
command $fname \"\$@\"
hash -r
}
"
}
hashafter xi hashafter xi
hashafter xbps-install hashafter xbps-install
hashafter xbps-remove hashafter xbps-remove
grep -q "void" /etc/os-release || return
alias xq="xbps-query -Rs" alias xq="xbps-query -Rs"
xqn() { xqn() {
@ -72,3 +63,6 @@ sv-manage() {
;; ;;
esac esac
} }
# renamed package binaries
alias ts=moreutils_ts

20
zshrc
View file

@ -35,6 +35,19 @@ try-source() {
fi fi
done done
} }
# run hash -r after the given command. Useful for package manager commands that
# change installed packages
hashafter () {
local fname=$1
eval "
function $fname() {
command $fname \"\$@\"
hash -r
}
"
}
exists() { command -v "$@" >/dev/null } exists() { command -v "$@" >/dev/null }
function(){ function(){
@ -66,12 +79,5 @@ if exists stack; then
eval "$(stack --bash-completion-script stack)" eval "$(stack --bash-completion-script stack)"
fi fi
if exists pyenv; then
eval "$(pyenv init -)"
if pyenv commands | grep -q 'virtualenv'; then
eval "$(pyenv virtualenv-init -)"
fi
fi
exists todo && todo exists todo && todo
exists thefuck && eval $(thefuck --alias) exists thefuck && eval $(thefuck --alias)