zsh: cleanup functions

pull/6/head
bretello 2022-03-31 19:37:57 +02:00
parent 5393f33795
commit 486ee8afbf
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
1 changed files with 2 additions and 30 deletions

View File

@ -53,7 +53,7 @@ function ppath
## Color string with given color. Usage: `color $NAME "string"`, available colors in `colors.sh`
function color
{
color=$1
local color=$1
shift 1
echo -e "${color}$@${CLEAR}"
}
@ -160,7 +160,7 @@ function genpwd
## List defined functions in $DOTFILES/functions.sh
function list_functions
{
grep --color=no -A 1 '^##' $DOTFILES/functions.zsh | sed -E 's/function (.*)/\1/g'
grep --color=no -A 1 '^##' $DOTFILES/functions/*.zsh| sed -E 's/function (.*)/\1/g'
}
@ -191,33 +191,6 @@ if [[ "$(uname)" == "Darwin" ]]; then
}
fi
pipupdate(){
set -x
if [[ "$1" == "user" ]]; then
user_flags='--user'
shift
fi
if [[ -n "$@" ]]; then
pip="$1"
shift
flags="$*"
echo "pip command is: '$pip $flags'"
if ! command -v "$pip" ; then
echo "Given command ($1) does not exist." 1>&2
return
fi
else
pip='python'
flags='-m pip'
echo "Using default pip: $pip $flags"
fi
for package in $($pip $flags freeze $user_flags --local | grep -v '^\-e' | cut -d = -f 1) ; do
$pip $flags install "$user_flags" -U "$package"
done
set +x
}
# unzip file to directory with the same name of the zip file (without extension)
function unzipd {
@ -244,7 +217,6 @@ function retry() {
}
__completion_wrapper(){
# Wrapper for completion functions.
# These can be used to force loading of all completions