-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
82 lines (68 loc) · 2.07 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Default editor
export EDITOR=/usr/bin/vim
export VISUAL=/usr/bin/vim
export TERM=screen-256color-bce
# Rust
export CARGO=/home/abronan/.cargo
export PATH=$PATH:$CARGO/bin
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
export PATH=$PATH:$RUST_SRC_PATH
# Export nightly channel flag for cargo fmt (rustfmt-nightly)
# See: https://github.com/rust-lang-nursery/rustfmt/issues/2188
export CFG_RELEASE_CHANNEL=nightly
# Project specific
export MANTISSA_BIN=/home/abronan/devenv/mantissa/target/debug
export PATH=$PATH:$MANTISSA_BIN
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/local/lib"
# MPD daemon start
[ ! -s ~/.config/mpd/pid ] && mpd ~/.config/mpd/mpd.conf
# Git aliases
alias gst='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gogo='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias got='git '
alias get='git '
# Special aliases
alias curl='noglob curl'
# Docker aliases
alias dps='docker ps -a'
alias cclean='docker rm -f $(docker ps -aq)'
alias iclean='docker rmi $(docker images -aq)'
alias idclean='docker rmi $(docker images -f "dangling=true" -q)'
# Zsh
source ~/.zshresources/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zshresources/zsh-history-substring-search/zsh-history-substring-search.zsh
# History UP and DOWN arrow keys
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# Z
. /usr/local/etc/profile.d/z.sh
# SSH Agent
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add
}
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi