-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathzshrc
More file actions
102 lines (83 loc) · 2.5 KB
/
zshrc
File metadata and controls
102 lines (83 loc) · 2.5 KB
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
# completion
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=** r:|=**' '+l:|=* r:|=*'
zstyle ':completion:*' max-errors 1
zstyle ':completion:*' menu select=5
zstyle ':completion:*' preserve-prefix '//[^/]##/'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
autoload -U compinit
compinit
#include zmv
autoload -U zmv
autoload -U colors
colors
# enable colored output from ls, etc
export CLICOLOR=1
if [[ -x /usr/bin/dircolors ]]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
export ZLSCOLORS="${LS_COLORS}"
fi
#put directory in titlebar
case $TERM in
*xterm*|ansi)
function settab { print -Pn "\e]1;${SSH_CONNECTION+"%n@%m:"} %~\a" }
function settitle { print -Pn "\e]2;${SSH_CONNECTION+"%n@%m:"} %~\a" }
function chpwd { settab;settitle }
settab;settitle
;;
esac
# No arguments: `git status`
# # With arguments: acts like `git`
g() {
if [[ $# > 0 ]]; then
git $@
else
git status
fi
}
# Complete g like git
compdef g=git
# automatically enter directories without cd
setopt auto_cd
# use vi (aliased) for editor
export EDITOR=vi
# aliases
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# emacs mode
bindkey -e
# use incremental search
bindkey '^R' '^R' '^R' history-incremental-search-backward
# ignore duplicate history entries
setopt histignoredups
# keep more history
export HISTSIZE=200
export SAVEHIST=200
export HISTFILE=~/.zsh_history
setopt append_history
setopt inc_append_history
setopt extended_history
setopt hist_find_no_dups
setopt hist_ignore_all_dups
setopt hist_reduce_blanks
setopt hist_ignore_space
setopt hist_no_store
setopt hist_no_functions
setopt no_hist_beep
setopt hist_save_no_dups
if [[ -d /usr/local/share/npm/bin ]]; then PATH=/usr/local/share/npm/bin:$PATH; fi
PATH=/usr/local/bin:~/bin:$PATH;
export PATH
# expand functions in the prompt
setopt prompt_subst
# prompt
export PROMPT='[${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%2c%{$reset_color%}] '
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn hg
zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
precmd () { vcs_info }
RPROMPT='${vcs_info_msg_0_}%f'