config/shell: new aliases
This commit is contained in:
parent
7f332e264a
commit
b870fa0681
|
@ -69,6 +69,9 @@ alias loce='noglob locei'
|
||||||
alias loca='noglob sudo updatedb -l 0 --prunenames "" --prunefs "tmpfs sysfs debugfs" --prunepaths "" -o /var/cache/locate-all.db &&
|
alias loca='noglob sudo updatedb -l 0 --prunenames "" --prunefs "tmpfs sysfs debugfs" --prunepaths "" -o /var/cache/locate-all.db &&
|
||||||
sudo chmod +r /var/cache/locate-all.db &&
|
sudo chmod +r /var/cache/locate-all.db &&
|
||||||
loci --database /var/cache/locate-all.db'
|
loci --database /var/cache/locate-all.db'
|
||||||
|
hunta() {
|
||||||
|
unbuffer hunt -h "$@" / | less -RF +G
|
||||||
|
}
|
||||||
|
|
||||||
# ZOXIDE {{{1
|
# ZOXIDE {{{1
|
||||||
alias c=z
|
alias c=z
|
||||||
|
|
|
@ -52,6 +52,12 @@ unalias rd 2>/dev/null
|
||||||
compdef help=man
|
compdef help=man
|
||||||
alias info='info --vi-keys'
|
alias info='info --vi-keys'
|
||||||
|
|
||||||
|
sudos() {
|
||||||
|
cmd=$1
|
||||||
|
shift
|
||||||
|
sudo "$(which $cmd)" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
resolvealias() {
|
resolvealias() {
|
||||||
alias "$1" 2>/dev/null | sed -n "s/$1='\?\(noglob \)\?\([-A-z]\+\)'\?\$/\2/p" | grep -m 1 . || echo $1
|
alias "$1" 2>/dev/null | sed -n "s/$1='\?\(noglob \)\?\([-A-z]\+\)'\?\$/\2/p" | grep -m 1 . || echo $1
|
||||||
}
|
}
|
||||||
|
@ -212,6 +218,7 @@ alias st='synct'
|
||||||
command -v dtrx >/dev/null && alias ex='dtrx'
|
command -v dtrx >/dev/null && alias ex='dtrx'
|
||||||
alias expr='noglob expr'
|
alias expr='noglob expr'
|
||||||
alias get='noglob ='
|
alias get='noglob ='
|
||||||
|
alias bi='b .*ignore*'
|
||||||
|
|
||||||
# Shortcuts
|
# Shortcuts
|
||||||
alias kc='kdeconnect-cli --refresh && kdeconnect-cli --list-devices'
|
alias kc='kdeconnect-cli --refresh && kdeconnect-cli --list-devices'
|
||||||
|
@ -386,6 +393,7 @@ updateDeps() {
|
||||||
name="$1"
|
name="$1"
|
||||||
pattern="$2"
|
pattern="$2"
|
||||||
depth="4"
|
depth="4"
|
||||||
|
#test $# -gt 2 || echo "Please specify a new version!"
|
||||||
case $name in
|
case $name in
|
||||||
(gradle-wrapper.properties) depth=6;;
|
(gradle-wrapper.properties) depth=6;;
|
||||||
esac
|
esac
|
||||||
|
@ -398,13 +406,13 @@ updateDeps() {
|
||||||
esac
|
esac
|
||||||
shift 2
|
shift 2
|
||||||
done
|
done
|
||||||
echo name $name depth $depth pattern $oldversion version $version
|
echo name "'$name'" depth "'$depth'" pattern "'$oldversion'" version "'$version'"
|
||||||
find -maxdepth $depth -type f -name $name | while read f
|
find -maxdepth $depth -not \( -name "*forks" -prune \) -type f -name $name | while read f
|
||||||
do highlight $f
|
do highlight $f
|
||||||
sed -i "s/\($pattern\)$oldversion/\1$version/gw /dev/stdout" $f
|
sed -i "s/\($pattern\)\($oldversion\)/\1${version:-\2}/gw /dev/stdout" $f
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
alias updateKotlin="updateDeps build.gradle.kts 'kotlin(\"jvm\") version ' --version"
|
alias updateKotlin="updateDeps build.gradle.kts 'kotlin(\"jvm\") version \"' --version"
|
||||||
alias updateGradle='updateDeps gradle-wrapper.properties "services.gradle.org\/distributions\/gradle-" --version'
|
alias updateGradle='updateDeps gradle-wrapper.properties "services.gradle.org\/distributions\/gradle-" --version'
|
||||||
alias updateUtils="updateDeps build.gradle.kts '"'"com.github.Xerus2000.util", ".*", "'" --pattern '[^\"]\+' --version"
|
alias updateUtils="updateDeps build.gradle.kts '"'"com.github.Xerus2000.util", ".*", "'" --pattern '[^\"]\+' --version"
|
||||||
|
|
||||||
|
@ -531,9 +539,12 @@ umoul() {
|
||||||
fzf --select-1 --exit-0 | awk '{print $3}')" ||
|
fzf --select-1 --exit-0 | awk '{print $3}')" ||
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
|
while true; do
|
||||||
case "$PWD" in
|
case "$PWD" in
|
||||||
("$mountpoint"*) builtin cd "$(dirname $mountpoint)";;
|
("$mountpoint"*) popd || builtin cd "$(dirname $mountpoint)";;
|
||||||
|
(*) break;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
# pass on all args except last
|
# pass on all args except last
|
||||||
moul -u "${@:1:$(((# > 1) ? #-1 : 0))}" "$mountpoint"
|
moul -u "${@:1:$(((# > 1) ? #-1 : 0))}" "$mountpoint"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue