From fcd0ec76467b0bd60c91cef1bfe09c2eec0f8971 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 16 Jul 2021 18:26:58 +0200 Subject: [PATCH] used to two spaces --- zsh/.zshenv | 4 +-- zsh/.zshrc | 72 ++++++++++++++++++++++++++++++++--------------------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/zsh/.zshenv b/zsh/.zshenv index f873363..d2fdf60 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -6,9 +6,9 @@ export GOPATH="$HOME/.go" export PATH="$HOME/.cargo/bin:$HOME/.gem/bin:$GOPATH/bin:$HOME/.local/bin:/opt/homebrew/bin:$PATH" if [[ -x /usr/bin/nvim ]]; then - export EDITOR=nvim + export EDITOR=nvim elif [[ -x /usr/bin/vim ]]; then - export EDITOR=vim + export EDITOR=vim fi export LESS=-R diff --git a/zsh/.zshrc b/zsh/.zshrc index 169423a..10f619e 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -19,12 +19,12 @@ bindkey -e bindkey "^r" history-incremental-search-backward if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init() { - echoti smkx - } + function zle-line-init() { + echoti smkx + } function zle-line-finish() { - echoti rmkx + echoti rmkx } zle -N zle-line-init @@ -32,24 +32,24 @@ zle -N zle-line-finish fi if [[ "${terminfo[khome]}" != "" ]]; then - bindkey "${terminfo[khome]}" beginning-of-line + bindkey "${terminfo[khome]}" beginning-of-line fi if [[ "${terminfo[kend]}" != "" ]]; then - bindkey "${terminfo[kend]}" end-of-line + bindkey "${terminfo[kend]}" end-of-line fi if [[ "${terminfo[kcbt]}" != "" ]]; then - bindkey "${terminfo[kcbt]}" reverse-menu-complete + bindkey "${terminfo[kcbt]}" reverse-menu-complete fi if [[ "${terminfo[kdch1]}" != "" ]]; then - bindkey "${terminfo[kdch1]}" delete-char + bindkey "${terminfo[kdch1]}" delete-char else - # fallbacks - bindkey "^[[3~" delete-char - bindkey "^[3;5~" delete-char - bindkey "\e[3~" delete-char + # fallbacks + bindkey "^[[3~" delete-char + bindkey "^[3;5~" delete-char + bindkey "\e[3~" delete-char fi zstyle ':completion:*:commands' rehash 1 @@ -63,21 +63,21 @@ zstyle ':vcs_info:*' formats "[%{$fg_bold[cyan]%}%b%{$reset_color%}]" zstyle ':vcs_info:*' actionformats "[%{$fg_bold[cyan]%}%b%{$reset_color%}|%a]" if [[ -f /run/.containerenv && -f /run/.toolboxenv ]]; then - TOOLBOX="%F{13}⬢%f " + TOOLBOX="%F{13}⬢%f " else - TOOLBOX="" + TOOLBOX="" fi PROMPT="${TOOLBOX}(%M) %~ %{$fg[red]%}%(#~#~$)%{$reset_color%} " RPROMPT="\$vcs_info_msg_0_" precmd () { - print -Pn "\e]0;(%M) %~\a" - vcs_info + print -Pn "\e]0;(%M) %~\a" + vcs_info } preexec () { - print -Pn "\e]0;(%M) $1\a" + print -Pn "\e]0;(%M) $1\a" } alias :q="exit" @@ -85,21 +85,37 @@ alias ..="cd .." [[ -x /usr/bin/xdg-open ]] && alias open="xdg-open" sshl() { - ssh -N -L ${1}:localhost:${2} $3 + ssh -N -L ${1}:localhost:${2} $3 } -toolbox() { - if [[ $@ =~ (enter) && ! $@ =~ (-r|--release|-d|--distro) ]]; then +#toolbox() { +# if [[ $@ =~ (enter) && ! $@ =~ (-r|--release|-d|--distro) ]]; then +# +# CONTAINER=$(sed -E -e 's/enter|--container|-c|toolbox|\t|\n|\s//g' <<< $@) +# +# if [[ ! -z ${CONTAINER} && ${CONTAINER} =~ "^[a-zA-Z0-9-]{1,15}$" ]]; then +# command toolbox --container ${CONTAINER} run sudo hostname ${CONTAINER} +# command toolbox enter ${CONTAINER} +# else +# command toolbox enter +# fi +# else +# command toolbox $@ +# fi +#} - CONTAINER=$(sed -E -e 's/enter|--container|-c|toolbox|\t|\n|\s//g' <<< $@) +dupfind() { + if [ $# -lt 1 ]; then + echo "Usage: $0 THREAD_COUNT [directory] ..." > /dev/stderr + fi - if [[ ! -z ${CONTAINER} && ${CONTAINER} =~ "^[a-zA-Z0-9-]{1,15}$" ]]; then - command toolbox --container ${CONTAINER} run sudo hostname ${CONTAINER} - command toolbox enter ${CONTAINER} - else - command toolbox enter - fi + if ! [[ "$1" =~ ^[0-9]+$ ]]; then + echo "THREAD_COUNT needs to be an integer." > /dev/stderr else - command toolbox $@ + if [ $# -lt 2 ]; then + find . ! -empty -type f -print0 | xargs -0 -n1 -P${1} md5sum | sort | uniq -w32 -dD + else + find ${@:2:128} ! -empty -type f -print0 | xargs -0 -n1 -P${1} md5sum | sort | uniq -w32 -dD + fi fi }