-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
138 lines (106 loc) · 2.93 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/zsh
# Author: Nick Brooks <[email protected]>
# shamelessly stole snippets from Seth House
#
# Integrated the git status from
# https://github.com/olivierverdier/zsh-git-prompt
source ~/.zsh/zshrc.sh
# Setup some colors that I like
fg_purple=%{$'\e[0;35m'%}
fg_cyan=%{$'\e[0;36m'%}
fg_lgray=%{$'\e[0;37m'%}
fg_dgray=%{$'\e[1;30m'%}
fg_white=%{$'\e[1;37m'%}
#Attributes
at_normal=%{$'\e[0m'%}
PROMPT='
${fg_dgray}%n@%m${fg_white}[${fg_cyan}%~${fg_white}] $(git_super_status)
[${fg_dgray}%T${fg_white}]:${at_normal}'
# {{{ set us up some options
autoload edit-command-line
autoload -U compinit
compinit
setopt \
auto_cd \
auto_pushd \
chase_links \
noclobber \
complete_aliases \
extended_glob \
hist_ignore_all_dups \
hist_ignore_space \
share_history \
no_flow_control \
list_types \
mark_dirs \
path_dirs \
prompt_percent \
prompt_subst \
rm_star_wait \
append_history
# }}}
# {{{ environment stuffs
path+=( $HOME/bin /sbin /usr/sbin /usr/local/sbin ); path=( ${(u)path} );
HISTFILE=~/.zsh_history
HISTFILESIZE=65536
HISTSIZE=4096
SAVEHIST=4096
REPORTTIME=60 # Report time statistics for progs that take more than a minute to run
WATCH=notme # Report any login/logout of other users
WATCHFMT='%n %a %l from %m at %T.'
# utf-8 setup
LANG=en_US.UTF-8
LC_ALL=$LANG
LC_COLLATE=C
EDITOR=vim
export EDITOR
alias editor=$EDITOR
export LSCOLORS='ExGxBxDxCxEgEdxbxgxcxd'
export GIT_CONFIG="$HOME/.gitconfig"
case $TERM in
xterm*)
precmd () {print -Pn "\e]0;%n@%m: %~\a"}
;;
esac
# {{{ completions
compinit -C
zstyle ':completion:*' list-colors "$LS_COLORS"
zstyle -e ':completion:*:(ssh|scp|sshfs|ping|telnet|nc|rsync):*' hosts '
reply=( ${=${${(M)${(f)"$(<~/.ssh/config)"}:#Host*}#Host }:#*\**} )'
# }}}
#Aliases
alias vi='vim'
alias vim='vim -u ~/.vimrc'
alias ls='ls -F --color'
alias l='ls -lFh'
alias la='ls -lAFh'
alias ll='ls -lh'
alias df='df -h'
alias cp='cp -pi'
alias gitlog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit'"
alias flushdns='sudo killall -HUP mDNSResponder'
alias console='screen /dev/tty.usbserial 9600'
# Quickly ssh through a bastian host without having to hard-code in ~/.ssh/config
alias pssh='ssh -o "ProxyCommand ssh $PSSH_HOST nc -w1 %h %p"'
# OSX Specific
if [[ $(uname) == "Darwin" ]]; then
alias ls='ls -FG'
alias lynx='lynx -cfg=$HOME/.lynx.cfg'
alias top='top -ocpu'
fi
# {{{ joinpdf()
# Merges, or joins multiple PDF files into "joined.pdf"
joinpdf () {
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=joined.pdf "$@"
}
# }}
# Output total memory currently in use by you {{{1
memtotaller() {
/bin/ps -u $(whoami) -o pid,rss,command | awk '{sum+=$2} END {print "Total " sum / 1024 " MB"}'
}
# }}}
DISABLE_AUTO_TITLE="true"
tt () {
echo -e "\033];$@\007"
}
# EOF