zsh: Add some magic for ssh-agent

master
Taeyeon Mori 8 years ago
parent 896f79861d
commit c69ba74401
  1. 29
      zsh/zshrc

@ -1,11 +1,11 @@
# #
# Executes commands at the start of an interactive session. # Executes commands at the start of an interactive session.
# #
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
# #
#
# Set the list of directories that Zsh searches for programs. # Set the list of directories that Zsh searches for programs.
#
fpath=( fpath=(
$DOTFILES/zsh/functions $DOTFILES/zsh/functions
$fpath $fpath
@ -13,13 +13,16 @@ fpath=(
typeset -gU fpath typeset -gU fpath
#
# Source Prezto. # Source Prezto.
#
if [[ -s "${ZDOTDIR}/prezto/init.zsh" ]]; then if [[ -s "${ZDOTDIR}/prezto/init.zsh" ]]; then
source "${ZDOTDIR}/prezto/init.zsh" source "${ZDOTDIR}/prezto/init.zsh"
fi fi
# Customize to your needs... #
# Git
#
# Revive old gst alias from OMZ/git # Revive old gst alias from OMZ/git
alias gst="git status" alias gst="git status"
@ -44,8 +47,24 @@ function gupf {
) )
} }
# rsync options #
# SSH
#
if (( $+commands[systemctl] )); then
eval "$(systemctl --user show-environment | grep '^SSH_AUTH_SOCK=')"
fi
if [ -n $SSH_AUTH_SOCK -a -f "$XDG_RUNTIME_DIR/ssh-agent.sock" ]; then
SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.sock"
fi
export SSH_AUTH_SOCK
#
# rsync
#
alias rsync="rsync -aXzPvihs -e ssh" alias rsync="rsync -aXzPvihs -e ssh"
#
# Local overrides # Local overrides
#
[[ -e "$DOTFILES/zsh/zshrc.local" ]] && source "$DOTFILES/zsh/zshrc.local" [[ -e "$DOTFILES/zsh/zshrc.local" ]] && source "$DOTFILES/zsh/zshrc.local"

Loading…
Cancel
Save