config/shell: add some simple aliases

This commit is contained in:
xeruf 2021-07-29 16:06:56 +02:00
parent afdb845fd1
commit 023d79be53
2 changed files with 9 additions and 4 deletions

View File

@ -49,6 +49,7 @@ let g:firenvim_config = {
\ '.*stackexchange\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*stackexchange\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*stackoverflow\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*stackoverflow\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*com/questions/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', }, \ '.*com/questions/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
\ '.*com/posts/[0-9]+/.*': { 'priority': 9, 'takeover': 'never', },
\ } \ }
\ } \ }
if exists('g:started_by_firenvim') if exists('g:started_by_firenvim')

View File

@ -16,7 +16,7 @@ alias info='info --vi-keys'
d() { d() {
local query="$(zf "$@")" local query="$(zf "$@")"
# First find out whether there is an obvious match # First find out whether there is an obvious match
# (at least 3 matches & score at least ten times above runner-up or score above 20) # (score at least ten times above runner-up and score above 20)
# If not select with fzf, using locate to find extra options # If not select with fzf, using locate to find extra options
cd "$(if expr "$(echo "$query" | head -1 | cut -d' ' -f2)" \> 20 \& $(echo "$query" | sed 'N;s|/.*\n|> 10 *|;q' | sed 's| */.*||') >/dev/null 2>&1 cd "$(if expr "$(echo "$query" | head -1 | cut -d' ' -f2)" \> 20 \& $(echo "$query" | sed 'N;s|/.*\n|> 10 *|;q' | sed 's| */.*||') >/dev/null 2>&1
then echo "$query" | head -1 then echo "$query" | head -1
@ -28,6 +28,7 @@ di() {
} }
alias c=z alias c=z
alias v=edit alias v=edit
alias hx='sudo hexedit --maximize --color'
xdh="$XDG_DATA_HOME" xdh="$XDG_DATA_HOME"
xch="$XDG_CONFIG_HOME" xch="$XDG_CONFIG_HOME"
@ -320,6 +321,9 @@ mkcd() {
mkdir -p "$1" && cd "$1" mkdir -p "$1" && cd "$1"
} }
alias move='rsync --recursive --progress --human-readable --remove-source-files'
alias rdiff='rsync --recursive --progress --delete --links --dry-run'
# mv with automatic sudo if neccessary # mv with automatic sudo if neccessary
smv() { smv() {
test -w "$1" && test -w "$(dirname $2)" && mv "$@" || sudo mv "$@" test -w "$1" && test -w "$(dirname $2)" && mv "$@" || sudo mv "$@"
@ -398,8 +402,8 @@ clean() {
highlight "c to clean local caches" highlight "c to clean local caches"
if [[ $1 =~ "c" ]]; then if [[ $1 =~ "c" ]]; then
find -name ".gradle" -o -name "generated" -o -name "dist_newstyle" -o -name "cache" -o -name "node_modules" -print -exec rm -r {} + find -name ".gradle" -o -name "generated" -o -name "dist_newstyle" -o -name "cache" -o -name "node_modules" -print -exec rm -r {} + -prune
find -name "*build" -exec rm -rI {} + find -name "*build" -print -exec rm -rI {} + -prune
fi fi
if test "$BASH_VERSION"; then if test "$BASH_VERSION"; then