From 47b871b76b89129a3469009fc3854b8da4bbb5a0 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Fri, 11 Mar 2022 18:14:21 +0200 Subject: [PATCH] Format zsh files --- home/.config/zsh/01-env.zsh | 10 +++++----- home/.config/zsh/02-plugins.zsh | 4 ++-- home/.config/zsh/05-misc.zsh | 2 +- home/.config/zsh/06-pacman.zsh | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/home/.config/zsh/01-env.zsh b/home/.config/zsh/01-env.zsh index a058a5e..db037d6 100644 --- a/home/.config/zsh/01-env.zsh +++ b/home/.config/zsh/01-env.zsh @@ -39,10 +39,10 @@ export FZF_COMPLETION_TRIGGER='**' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"' _fzf_compgen_dir() { - fd -Ht d + fd -Ht d } _fzf_compgen_path() { - fd -Ht f + fd -Ht f } # dotfile repository location @@ -61,9 +61,9 @@ export GPG_TTY="$(tty)" # set SSH_AUTH_SOCK if not logging in over SSH if [ "$SSH_CONNECTION" = "" ]; then - export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - #gpgconf --launch gpg-agent - gpg-connect-agent updatestartuptty /bye >/dev/null + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + #gpgconf --launch gpg-agent + gpg-connect-agent updatestartuptty /bye >/dev/null fi # Enable grc colorization of supported commands diff --git a/home/.config/zsh/02-plugins.zsh b/home/.config/zsh/02-plugins.zsh index bd20e77..d8d5a65 100644 --- a/home/.config/zsh/02-plugins.zsh +++ b/home/.config/zsh/02-plugins.zsh @@ -1,7 +1,7 @@ # install zinit if it's not already installed if [ ! -f ~/.zinit/bin/zinit.zsh ]; then - mkdir ~/.zinit - git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin + mkdir ~/.zinit + git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin fi source ~/.zinit/bin/zinit.zsh diff --git a/home/.config/zsh/05-misc.zsh b/home/.config/zsh/05-misc.zsh index 10ddf01..5118b02 100644 --- a/home/.config/zsh/05-misc.zsh +++ b/home/.config/zsh/05-misc.zsh @@ -1,6 +1,6 @@ # Launch tmux if logging in over ssh if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then - tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux + tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux fi # share history between running zsh instances diff --git a/home/.config/zsh/06-pacman.zsh b/home/.config/zsh/06-pacman.zsh index 0398c37..d0e2370 100644 --- a/home/.config/zsh/06-pacman.zsh +++ b/home/.config/zsh/06-pacman.zsh @@ -5,13 +5,13 @@ zshcache_time="$(date +%s%N)" autoload -Uz add-zsh-hook rehash_precmd() { - if [[ -a /var/cache/zsh/pacman ]]; then - local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" - if (( zshcache_time < paccache_time )); then - rehash - zshcache_time="$paccache_time" + if [[ -e /var/cache/zsh/pacman ]]; then + local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" + if ((zshcache_time < paccache_time)); then + rehash + zshcache_time="$paccache_time" + fi fi - fi } add-zsh-hook -Uz precmd rehash_precmd