git ssb


0+

cryptix / dotcryptix



Tree: c475ad20c2c71140f39209984924cedf63e14d6d

Files: c475ad20c2c71140f39209984924cedf63e14d6d / zshrc

1381 bytesRaw
1export ZSH=~/.zsh
2
3#--+ environment
4[ -f ~/.env ] && . ~/.env
5
6#--+ aliases
7[ -f ~/.alias ] && . ~/.alias
8
9
10case $TERM in
11 (*xterm* | rxvt*)
12
13 # Write some info to terminal title.
14 # This is seen when the shell prompts for input.
15 function precmd {
16 print -Pn "\e]0;zsh%L %(1j,%j job%(2j|s|); ,)%~\a"
17 }
18 # Write command and args to terminal title.
19 # This is seen while the shell waits for a command to complete.
20 function preexec {
21 printf "\033]0;%s\a" "$1"
22 }
23
24 ;;
25esac
26
27source $ZSH/zsh-git-prompt/zshrc.sh
28PROMPT='%B%M%b$(git_super_status) %# '
29
30[[ -t 1 ]] || return
31case $TERM in
32 *xterm*|*rxvt*|(dt|k|E|a)term)
33 function preexec {
34 print -Pn "\e]2;[%n@%m] %~ %# $1\a"
35 }
36 ;;
37 screen*)
38 function preexec {
39 print -Pn "\e\"$1\e\134"
40 }
41 ;;
42esac
43
44# Load and run compinit
45autoload -U compinit
46compinit -i
47
48SSH_ENV="$HOME/.ssh/environment"
49
50function start_agent {
51 echo "Initialising new SSH agent..."
52 ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
53 echo succeeded
54 chmod 600 "${SSH_ENV}"
55 . "${SSH_ENV}" #> /dev/null
56}
57
58## Source SSH settings, if applicable
59if [ -S "${SSH_AUTH_SOCK}" ];then
60 echo "found agent forwarding"
61else
62 if [ -f "${SSH_ENV}" ]; then
63 . "${SSH_ENV}" > /dev/null
64 # TODO: quickfix
65 test $(pgrep ssh-agent | wc -l) -eq 0 && start_agent;
66 else
67 start_agent;
68 fi
69fi
70

Built with git-ssb-web