-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
99 lines (83 loc) · 2.83 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory
unsetopt autocd beep
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '~/.zshrc_comp'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Format tab completion.
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
# Ignore duplicate lines in the history.
setopt HIST_IGNORE_DUPS
# Colors
autoload -U colors
colors
setopt prompt_subst
# Env Variables.
export EDITOR=vim
export VIMDIR=$HOME/.vim
export VIMRC=$VIMDIR/vimrc
export CUSTOM_VIMRC=$VIMDIR/personal.vim
export GOPATH=$HOME/projects
export PATH=$GOPATH/bin:$PATH
export GITHUB=$HOME/github
alias cp='cp -i'
alias diff='colordiff'
alias dir='dir --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
#alias l='ls -CF'
#alias la='ls -A'
#alias ll='ls -alFh'
#alias ls='ls --color=auto'
alias mv='mv -i'
alias openports='netstat --all --numeric --programs --inet'
alias vdir='vdir --color=auto'
alias vimc='vim --servername SAMPLESERVER --remote-tab-silent'
alias vims='vim --servername SAMPLESERVER'
alias update_subs='git submodule foreach git pull origin master'
# Remove all vim swap files in a directory.
alias remove_swap='find ./ -type f -name "\.*sw[klmnop]" -delete'
# Remove all pyc files in a directory.
alias remove_pyc='find . -name "*.pyc" -exec rm -rf {} \;'
alias replace_str='find . -name "*.html" -print0 | xargs -0 sed -i "" -e "s/token-search/token-options/g"'
# Save a smiley to a local variable if the last command exited with success.
local smiley="%(?,%{$fg[green]%}✓%{$reset_color%},%{$fg[red]%}✗%{$reset_color%})"
# Show Git branch in prompt.
source $GITHUB/vim345/zsh/plugins/zsh-git-prompt/zshrc.sh
# Prompt customization.
PROMPT='┌ %U%*%u - $(git_super_status) %{$fg[red]%}%n@%{$fg[green]%}%m - %{$reset_color%}%B[%~]%b
└→[${smiley}] ⚑⚑⚑ '
# Enable syntax highlighting.
source $GITHUB/vim345/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
# Predictable SSH authentication socket location.
SOCK="/tmp/ssh-agent-$USER-screen"
if test $SSH_AUTH_SOCK && [ $SSH_AUTH_SOCK != $SOCK ]
then
rm -f /tmp/ssh-agent-$USER-screen
ln -sf $SSH_AUTH_SOCK $SOCK
export SSH_AUTH_SOCK=$SOCK
fi
# Directory stacking.
DIRSTACKFILE="$HOME/.cache/zsh/dirs"
if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
[[ -d $dirstack[1] ]] && cd $dirstack[1]
fi
chpwd() {
print -l $PWD ${(u)dirstack} >$DIRSTACKFILE
}
DIRSTACKSIZE=20
setopt autopushd pushdsilent pushdtohome
## Remove duplicate entries
setopt pushdignoredups
## This reverts the +/- operators.
setopt pushdminus