-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
executable file
·94 lines (80 loc) · 2.32 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
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="agnoster"
plugins=(git github python mercurial zsh-syntax-highlighting juju nova)
DISABLE_UPDATE_PROMPT=true
source $ZSH/oh-my-zsh.sh
umask 002
# history
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt EXTENDED_HISTORY
HISTSIZE=50000
SAVEHIST=50000
HISTFILE=~/.zsh_history
export HISTFILE HISTSIZE SAVEHIST
# handy aliases
if type trash &> /dev/null; then
alias rm="trash"
fi
alias e="mvim"
alias ssh="ssh -A"
alias rpry="rails-console-pry -r pry-doc -r awesome_print"
alias df="df -H"
alias du="du -h"
alias hr="hg record"
alias hs="hg status"
alias lxc-ls="sudo lxc-ls --fancy"
alias less="less -FX"
alias ls="ls -h --color"
alias sml="rlwrap sml"
alias eamcs="emacs -nw"
alias emacs="emacsclient -c -a emacs"
alias make="noglob make"
alias ack="ack-grep"
alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
alias rsync="rsync --progress"
if [[ $os != 'darwin' ]]; then
alias mode="stat -c '%a %n'"
alias open="xdg-open"
fi
if [[ $os == 'darwin' ]]; then
alias flushdns="sudo killall -HUP mDNSResponder"
fi
## dircolors
eval `dircolors ~/dotfiles/dircolors.ansi-dark`
## tmux
# needed for 256 colours in term2
alias tmux="TERM=screen-256color-bce tmux"
## binds
bindkey -e # emacs mode
bindkey '^R' history-incremental-search-backward
## todos
function todo(){ if [ $# -eq 0 ]; then cat $TODO; else echo "• $@" >> $TODO; fi }
function todone() { sed -i -e "/$*/d" $TODO; }
function check_response() { curl -s -w %{time_total}\\n -o /dev/null $1 }
function pomo() { sleep 1500 && notify-send "Break" }
function break5() { sleep 300 && notify-send "Back to work" }
function break15() { sleep 900 && notify-send "Back to work" }
export VIRTUAL_ENV_DISABLE_PROMPT=
if [ -f "/usr/local/share/python/virtualenvwrapper.sh" ]; then
. /usr/local/share/python/virtualenvwrapper.sh
fi
if [ -f "/usr/share/virtualenvwrapper/virtualenvwrapper.sh" ]; then
. /usr/share/virtualenvwrapper/virtualenvwrapper.sh
fi
if [ -f "/usr/local/bin/virtualenvwrapper.sh" ]; then
. /usr/local/bin/virtualenvwrapper.sh
fi
export WORKON_HOME=~/envs
# set user@host only on remote hosts
[[ -n "$SSH_CLIENT" ]] || export DEFAULT_USER="kit"
# fix for dumb terminals (emacs tramp)
if [[ "$TERM" == "dumb" ]]
then
unsetopt zle
unsetopt prompt_cr
unsetopt prompt_subst
unfunction precmd
unfunction preexec
PS1='$ '
fi