diff --git a/.config/zsh/.zlogin b/.config/zsh/.zlogin index e373761..79ecfe9 100755 --- a/.config/zsh/.zlogin +++ b/.config/zsh/.zlogin @@ -2,6 +2,7 @@ ## Load config files in $ZSH/lib that for stage 3 for config_file (${ZLIBDIR}/30-*.zsh) source $config_file +unset config_file ## Compile startup files zwcautocompile diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 86be1e3..c4d5cd1 100755 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -2,3 +2,4 @@ # Load config files in $ZSH/lib that for stage 2 for config_file (${ZLIBDIR}/20-*.zsh) source $config_file +unset config_file diff --git a/.config/zsh/autoload/dc b/.config/zsh/autoload/dc index 9441cf8..e225e59 100755 --- a/.config/zsh/autoload/dc +++ b/.config/zsh/autoload/dc @@ -10,12 +10,12 @@ function dc() { # Save current working directory CURRENT_DIR="${PWD}" - for file in $(find ${PWD} -maxdepth 2 -type f -regextype posix-extended -regex '.*(docker-compose|compose)\.ya?ml' | sort); do - cd $(dirname "$file") - docker compose $@ + for file in $(find "${PWD}" -maxdepth 2 -type f \( -name "docker-compose.yml" -o -name "docker-compose.yaml" -o -name "compose.yml" -o -name "compose.yaml" \) | sort); do + cd "$(dirname "$file")" + docker compose "$@" done # Change back to saved working directory - cd ${CURRENT_DIR} + cd "${CURRENT_DIR}" fi } diff --git a/.config/zsh/autoload/extract b/.config/zsh/autoload/extract index 2b15e5f..36ba601 100755 --- a/.config/zsh/autoload/extract +++ b/.config/zsh/autoload/extract @@ -5,7 +5,7 @@ function extract() { echo " extract [path/file_name_2.ext] [path/file_name_3.ext]" return 1 else - for n in $@; do + for n in "$@"; do if [ -f "$n" ]; then case "${n%,}" in *.tar.bz2 | *.tar.gz | *.tar.xz | *.tbz2 | *.tgz | *.txz | *.tar) diff --git a/.config/zsh/autoload/zwcautocompile b/.config/zsh/autoload/zwcautocompile index f6f24a9..b9112ef 100644 --- a/.config/zsh/autoload/zwcautocompile +++ b/.config/zsh/autoload/zwcautocompile @@ -3,19 +3,19 @@ function zwcautocompile() { autoload -Uz zrecompile - for f in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do - zrecompile -pq ${f} && rm -f ${f}.zwc.old + for f in $(find "${ZDOTDIR}" -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do + zrecompile -pq "${f}" && rm -f "${f}.zwc.old" done - if [[ -d ${ZAUTOLOADDIR} ]]; then - for f in ${ZAUTOLOADDIR}/*; do - zrecompile -pq ${f} && rm -f ${f}.zwc.old + if [[ -d "${ZAUTOLOADDIR}" ]]; then + for f in "${ZAUTOLOADDIR}"/*; do + zrecompile -pq "${f}" && rm -f "${f}.zwc.old" done fi - if [[ -d ${ZLIBDIR} ]]; then - for f in ${ZLIBDIR}/*; do - zrecompile -pq ${f} && rm -f ${f}.zwc.old + if [[ -d "${ZLIBDIR}" ]]; then + for f in "${ZLIBDIR}"/*; do + zrecompile -pq "${f}" && rm -f "${f}.zwc.old" done fi } diff --git a/.config/zsh/autoload/zwcpurge b/.config/zsh/autoload/zwcpurge index aad0fa0..8c5bed3 100644 --- a/.config/zsh/autoload/zwcpurge +++ b/.config/zsh/autoload/zwcpurge @@ -2,7 +2,7 @@ function zwcpurge() { autoload -Uz zrecompile - for zsh_file in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zwc" -o -name "*.zwc.old" \)); do - rm -f ${zsh_file} + for zsh_file in $(find "${ZDOTDIR}" -maxdepth 3 -type f \( -name "*.zwc" -o -name "*.zwc.old" \)); do + rm -f "${zsh_file}" done } diff --git a/.config/zsh/conf.d/20-aliases.zsh b/.config/zsh/conf.d/20-aliases.zsh index dfdc916..b1cbf3b 100755 --- a/.config/zsh/conf.d/20-aliases.zsh +++ b/.config/zsh/conf.d/20-aliases.zsh @@ -18,25 +18,20 @@ fi if ! _exists fetch; then if _exists curl; then alias fetch="curl -O" - elif _exists curl; then + elif _exists wget; then alias fetch="wget" else echo "fetch not found." fi fi -# htop -if _exists htop; then - alias htop="sudo htop" -fi - unfunction _exists alias mkdir="mkdir -p" alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." -alias google="ping -c 10240000 google.com" +alias google="ping google.com" alias history="history -i" case `uname` in diff --git a/.config/zsh/conf.d/20-autoload.zsh b/.config/zsh/conf.d/20-autoload.zsh index 04682fd..efef314 100755 --- a/.config/zsh/conf.d/20-autoload.zsh +++ b/.config/zsh/conf.d/20-autoload.zsh @@ -2,7 +2,7 @@ if [[ -d "${ZAUTOLOADDIR}" ]]; then - fpath=($fpath ${ZAUTOLOADDIR}) + fpath=(${ZAUTOLOADDIR} $fpath) # Load functions for func in ${ZAUTOLOADDIR}/*; do diff --git a/.config/zsh/conf.d/20-history.zsh b/.config/zsh/conf.d/20-history.zsh index b8a1d5f..36071bf 100755 --- a/.config/zsh/conf.d/20-history.zsh +++ b/.config/zsh/conf.d/20-history.zsh @@ -1,16 +1,13 @@ ## Command history configuration export HISTFILE="${ZCACHE}/history" -export HISTSIZE=1000000000 +export HISTSIZE=1000000 export SAVEHIST=${HISTSIZE} export HISTORY_IGNORE="([bf]g *|disown|cd ..|cd -)" -export HISTTIMEFORMAT="[%F %T] " -setopt INC_APPEND_HISTORY setopt EXTENDED_HISTORY +setopt SHARE_HISTORY setopt HIST_FIND_NO_DUPS -setopt hist_ignore_dups -setopt hist_verify -setopt incappendhistory -setopt histignorespace -setopt histnostore -setopt share_history \ No newline at end of file +setopt HIST_IGNORE_DUPS +setopt HIST_VERIFY +setopt HIST_IGNORE_SPACE +setopt HIST_NO_STORE \ No newline at end of file diff --git a/.config/zsh/conf.d/30-misc.zsh b/.config/zsh/conf.d/30-misc.zsh index 9ab449d..3249cfe 100755 --- a/.config/zsh/conf.d/30-misc.zsh +++ b/.config/zsh/conf.d/30-misc.zsh @@ -10,7 +10,7 @@ setopt long_list_jobs ## pager export LC_CTYPE=$LANG -export LC_ALL=de_DE.UTF-8 +export LANG=de_DE.UTF-8 export IOCAGE_COLOR=TRUE ## Set some app specific dirs with XDM scheme diff --git a/.config/zsh/conf.d/30-ssh-agent.zsh b/.config/zsh/conf.d/30-ssh-agent.zsh index b5c6e05..a62cc9d 100644 --- a/.config/zsh/conf.d/30-ssh-agent.zsh +++ b/.config/zsh/conf.d/30-ssh-agent.zsh @@ -20,11 +20,11 @@ if [[ "$OSTYPE" == darwin* ]]; then else # Linux/BSD: Start ssh-agent if not running if ! pgrep -u "$USER" ssh-agent > /dev/null; then - ssh-agent -t 1h > "$HOME/.ssh-agent.env" + ( umask 077; ssh-agent -t 1h > "$HOME/.ssh-agent.env" ) fi # Source ssh-agent environment - if [[ ! -S ~/.ssh/ssh_auth_sock && -f "$HOME/.ssh-agent.env" ]]; then + if [[ ! -S "$SSH_AUTH_SOCK" && -f "$HOME/.ssh-agent.env" ]]; then source "$HOME/.ssh-agent.env" >/dev/null fi diff --git a/.config/zsh/conf.d/30-zsh_unplugged.zsh b/.config/zsh/conf.d/30-zsh_unplugged.zsh index c6b0ece..31e0cfc 100755 --- a/.config/zsh/conf.d/30-zsh_unplugged.zsh +++ b/.config/zsh/conf.d/30-zsh_unplugged.zsh @@ -1,6 +1,6 @@ # get zsh_unplugged and store it with your other plugins if [[ ! -d ${ZPLUGINDIR}/zsh_unplugged ]]; then - git clone --quiet https://github.com/mattmc3/zsh_unplugged ${ZPLUGINDIR}/zsh_unplugged + git clone --quiet --depth 1 https://github.com/mattmc3/zsh_unplugged ${ZPLUGINDIR}/zsh_unplugged fi source ${ZPLUGINDIR}/zsh_unplugged/zsh_unplugged.zsh diff --git a/.zshenv b/.zshenv index 45bab45..147208a 100644 --- a/.zshenv +++ b/.zshenv @@ -15,3 +15,4 @@ export ZCACHE="${XDG_CACHE_HOME}/zsh" # Cache directory for history and zcompdum # Load config files in $ZSH/lib that for stage 1 for config_file (${ZLIBDIR}/10-*.zsh) source $config_file +unset config_file