diff --git a/.config/shell/functions b/.config/shell/functions index d90b082..8168236 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -59,9 +59,8 @@ pathadd() { } # ZSH completion and stuff {{{1 - alias rs="reset && exec $SHELL" -alias hist='print -z $(history | tac | fzf --tiebreak=index --bind="'"del:execute(echo \"'/;{4..}$/d'\" && sed '/;{4..}$/d' -i.bak $HISTFILE)"'" | sed "s|^ \+||" | cut -d" " -f5-)' +alias hist='print -z $(history | tac | fzf --tiebreak=index --bind='"'"'del:execute(sed "\;$(echo {4..})$d" -i.bak $HISTFILE)'"'"' | sed "s|^ \+||" | cut -d" " -f5-)' CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}" edshell() { diff --git a/.local/bin/scripts/arg-test b/.local/bin/scripts/arg-test index 8e1df09..50e0c2f 100755 --- a/.local/bin/scripts/arg-test +++ b/.local/bin/scripts/arg-test @@ -1,4 +1,6 @@ #!/bin/sh +{ echo "$# Args: $@" echo "${@:-default}" | sed 's/\(\w\+\)/\1-w/g' #echo "Last arg: ${@:$#}" +} | tee /tmp/args$(date +%s) diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index a06fdd4..f651e44 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -17,7 +17,7 @@ tput setaf 4 && $elevate file -E "$last" | ( grep -v --color=never 'directory$' case "$($elevate file --dereference --mime "$last")" in *inode/directory*) tput sgr0 && $(test -x "$last" || echo "sudo") ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --all "$@" | less -XF;; *binary) expr "$(file "$last")" : ".*compressed" >/dev/null && /usr/share/nvim/runtime/macros/less.sh "$@";; - *) $elevate bat --style header "$@" $(test -n "$elevate" || echo "--pager='less -XF'") + *) $elevate bat --style header "$@" "$(test -n "$elevate" || echo "--pager=less -XF")" tput setaf 3 && $elevate stat --format '%A size %sB, birth: %.10w mod %.10y' "$last" ;; esac diff --git a/.local/bin/scripts/bak b/.local/bin/scripts/bak index 5b60417..02ab7c7 100755 --- a/.local/bin/scripts/bak +++ b/.local/bin/scripts/bak @@ -3,7 +3,10 @@ suffix="${2:-bak}" orig="${1%%.$suffix}" smv () { eval source=\$$(($#-1)) - test -w "$source" && mv -v "$@" || sudo mv -v "$@" + if test -w "$source" + then mv -v "$@" + else sudo mv -v "$@" + fi } if test -e "$orig.$suffix" then diff --git a/.zprofile b/.zprofile index 61ce85a..5b17632 100644 --- a/.zprofile +++ b/.zprofile @@ -1,5 +1,6 @@ export DATA="$(test -d $HOME/data && echo $HOME/data || echo $HOME/daten)" export MUSIC="$DATA/music" +export JOURNAL="$DATA/2-standards/notes/journal" # xdg export XDG_DATA_HOME="$HOME/.local/share" @@ -51,7 +52,7 @@ export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell" # environment which nvim >/dev/null && export EDITOR='nvim' || export EDITOR='vim' export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)" -export IGNOREDIRS="-x dev -x .sync -x .stfolder -x .git -x .gradle -x .idea -x out -x *build -x dist_newstyle -x generated -x cache -x node_modules" +export IGNOREDIRS="-x dev -x .sync -x .stfolder -x .git -x .gradle -x .idea -x out -x *build -x dist_newstyle -x generated -x cache -x node_modules -x virtualenv" # red stderr test -f "/usr/lib/libstderred.so" && export LD_PRELOAD="/usr/lib/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}" # software config @@ -99,9 +100,6 @@ export CTEST_PROGRESS_OUTPUT=1 export CTEST_OUTPUT_ON_FAILURE=1 export CTEST_PARALLEL_LEVEL=3 - -export JOURNAL="$DATA/2-standards/notes/journal" - if test -z "${DISPLAY}" && test "$XDG_VTNR" -eq 1 && test -d "$JOURNAL"; then echo "What do you want to do?" while test $(echo "$intention" | wc -c) -lt 6