config/shell/functions: adjust syntax for full bash-compatibility
This commit is contained in:
parent
a722da0346
commit
20709434e3
|
@ -114,7 +114,7 @@ t() {
|
|||
then tn
|
||||
else
|
||||
if test "$1" = "do"
|
||||
then test "$2" -gt 0 2>/dev/null && task mod sched:today "${@:2}" || task add sched:today "${@:2}"
|
||||
then shift && test "$1" -gt 0 2>/dev/null && task mod sched:today "$@" || task add sched:today "$@"
|
||||
else task "$@"
|
||||
fi
|
||||
fi
|
||||
|
@ -203,18 +203,18 @@ alias mdox="xclip -o -selection clipboard | mdo | xclip -filter"
|
|||
alias gdiff='git diff --word-diff=color --word-diff-regex=. --no-index'
|
||||
|
||||
alias grp='grep --color=auto --line-number --ignore-case --binary-files=without-match --directories=skip'
|
||||
grpr() { grp --color=always --recursive $(echo $DIRS_IGNORE | sed 's/-x/--exclude-dir/g') "$@" | less -F }
|
||||
grpr() { grp --color=always --recursive $(echo $DIRS_IGNORE | sed 's/-x/--exclude-dir/g') "$@" | less -F; }
|
||||
|
||||
# Recover stray swap files from neovim
|
||||
alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs --no-run-if-empty nvim"
|
||||
alias vrecd="ls $XDG_DATA_HOME/nvim/swap | head -1 | xargs -r -i mv {} /tmp"
|
||||
|
||||
# I think this was something about recovering backup files
|
||||
unv() { strings $1 | sed 's/5$//' | dedup }
|
||||
unv() { strings $1 | sed 's/5$//' | dedup; }
|
||||
|
||||
alias hx='sudo hexedit --maximize --color'
|
||||
# Paginated hexyl
|
||||
hex() { hexyl "$@" | "${PAGER:-less}" }
|
||||
hex() { hexyl "$@" | "${PAGER:-less}"; }
|
||||
|
||||
alias dic="cat $XDG_DATA_HOME/dictcc/dict.txt | sed '/#/d;/&/d;/^$/d' | fzf --tiebreak=length --bind='alt-bspace:clear-query'"
|
||||
alias dict="rlwrap rdictcc -d $XDG_DATA_HOME/dictcc"
|
||||
|
@ -231,8 +231,8 @@ npm-reinstall() {
|
|||
|
||||
# Custom tools {{{1
|
||||
|
||||
sedcomment() { sed -i 's/$1/#\0/' "${@:2}" }
|
||||
seduncomment() { sed -i 's/#\($1\)/\0/' "${@:2}" }
|
||||
sedcomment() { sed -i "s/$1/#\0/" "${@:2}"; }
|
||||
seduncomment() { sed -i "s/#\($1\)/\0/" "${@:2}"; }
|
||||
|
||||
updateDeps() {
|
||||
name="$1"
|
||||
|
|
Loading…
Reference in New Issue