Format zsh files

This commit is contained in:
Marko Korhonen 2022-03-11 18:14:21 +02:00
parent 12e3660fc6
commit 47b871b76b
4 changed files with 14 additions and 14 deletions

View file

@ -39,10 +39,10 @@ export FZF_COMPLETION_TRIGGER='**'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"' export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
_fzf_compgen_dir() { _fzf_compgen_dir() {
fd -Ht d fd -Ht d
} }
_fzf_compgen_path() { _fzf_compgen_path() {
fd -Ht f fd -Ht f
} }
# dotfile repository location # dotfile repository location
@ -61,9 +61,9 @@ export GPG_TTY="$(tty)"
# set SSH_AUTH_SOCK if not logging in over SSH # set SSH_AUTH_SOCK if not logging in over SSH
if [ "$SSH_CONNECTION" = "" ]; then if [ "$SSH_CONNECTION" = "" ]; then
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
#gpgconf --launch gpg-agent #gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye >/dev/null gpg-connect-agent updatestartuptty /bye >/dev/null
fi fi
# Enable grc colorization of supported commands # Enable grc colorization of supported commands

View file

@ -1,7 +1,7 @@
# install zinit if it's not already installed # install zinit if it's not already installed
if [ ! -f ~/.zinit/bin/zinit.zsh ]; then if [ ! -f ~/.zinit/bin/zinit.zsh ]; then
mkdir ~/.zinit mkdir ~/.zinit
git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin
fi fi
source ~/.zinit/bin/zinit.zsh source ~/.zinit/bin/zinit.zsh

View file

@ -1,6 +1,6 @@
# Launch tmux if logging in over ssh # Launch tmux if logging in over ssh
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then 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 fi
# share history between running zsh instances # share history between running zsh instances

View file

@ -5,13 +5,13 @@ zshcache_time="$(date +%s%N)"
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
rehash_precmd() { rehash_precmd() {
if [[ -a /var/cache/zsh/pacman ]]; then if [[ -e /var/cache/zsh/pacman ]]; then
local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)"
if (( zshcache_time < paccache_time )); then if ((zshcache_time < paccache_time)); then
rehash rehash
zshcache_time="$paccache_time" zshcache_time="$paccache_time"
fi
fi fi
fi
} }
add-zsh-hook -Uz precmd rehash_precmd add-zsh-hook -Uz precmd rehash_precmd