-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathzshrc
48 lines (35 loc) · 825 Bytes
/
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
fpath=(~/.zsh/completion $fpath)
# completion
autoload -U compinit
compinit
# automatically enter directories without cd
setopt auto_cd
# use vim as an editor
export EDITOR=vim
# aliases
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# vi mode
bindkey -v
bindkey ^F vi-cmd-mode
# use incremental search
bindkey ^R history-incremental-search-backward
# expand functions in the prompt
setopt prompt_subst
# prompt
export PS1='[${SSH_CONNECTION+"%n@%m:"}%~] '
# ignore duplicate history entries
setopt histignoredups
# keep more history
export HISTSIZE=200
# look for ey config in project dirs
export EYRC=./.eyrc
# restore previous cwd
if [[ -f ~/.last_cwd ]]; then
cd `cat ~/.last_cwd`
fi
_save_last_cwd() {
echo `pwd` > ~/.last_cwd
}
chpwd_functions=( "${chpwd_functions[@]}" _save_last_cwd )