readd dupfind and indent
This commit is contained in:
24
zsh/.zshrc
24
zsh/.zshrc
@@ -65,7 +65,13 @@ zstyle ':vcs_info:*' enable git
|
|||||||
zstyle ':vcs_info:*' formats "[%{$fg_bold[cyan]%}%b%{$reset_color%}]"
|
zstyle ':vcs_info:*' formats "[%{$fg_bold[cyan]%}%b%{$reset_color%}]"
|
||||||
zstyle ':vcs_info:*' actionformats "[%{$fg_bold[cyan]%}%b%{$reset_color%}|%a]"
|
zstyle ':vcs_info:*' actionformats "[%{$fg_bold[cyan]%}%b%{$reset_color%}|%a]"
|
||||||
|
|
||||||
PROMPT="(%M) %~ %{$fg[red]%}%(#~#~$)%{$reset_color%} "
|
if [[ -f /run/.containerenv && -f /run/.toolboxenv ]]; then
|
||||||
|
TOOLBOX="%{$fg_bold[magenta]%}⬢%{$reset_color%} "
|
||||||
|
else
|
||||||
|
TOOLBOX=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
PROMPT="${TOOLBOX}(%M) %~ %{$fg[red]%}%(#~#~$)%{$reset_color%} "
|
||||||
RPROMPT="\$vcs_info_msg_0_"
|
RPROMPT="\$vcs_info_msg_0_"
|
||||||
|
|
||||||
precmd () {
|
precmd () {
|
||||||
@@ -89,4 +95,20 @@ sshn() {
|
|||||||
ssh -N -L ${1}:localhost:${2} $3
|
ssh -N -L ${1}:localhost:${2} $3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dupfind() {
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Usage: $0 THREAD_COUNT [directory] ..." > /dev/stderr
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [[ "$1" =~ ^[0-9]+$ ]]; then
|
||||||
|
echo "THREAD_COUNT needs to be an integer." > /dev/stderr
|
||||||
|
else
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
[[ -x /usr/bin/dircolors ]] && eval "$(dircolors)"
|
[[ -x /usr/bin/dircolors ]] && eval "$(dircolors)"
|
||||||
|
|||||||
Reference in New Issue
Block a user