author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Thu, 13 Aug 2015 21:58:45 +0300 | |
changeset 746 | 5dfc65f89cf0 |
parent 653 | a5566b182446 |
child 749 | 89208f64214c |
permissions | -rw-r--r-- |
215
7b1b6872e92e
Include system wide /etc/zshrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
214
diff
changeset
|
1 |
|
7b1b6872e92e
Include system wide /etc/zshrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
214
diff
changeset
|
2 |
if [[ -e /etc/zshrc ]]; then |
7b1b6872e92e
Include system wide /etc/zshrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
214
diff
changeset
|
3 |
. /etc/zshrc |
7b1b6872e92e
Include system wide /etc/zshrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
214
diff
changeset
|
4 |
fi |
179
ed15e30ff41a
Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
177
diff
changeset
|
5 |
|
653
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
651
diff
changeset
|
6 |
if [[ -f ~/.env ]]; then |
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
651
diff
changeset
|
7 |
. ~/.env |
a5566b182446
Use .env file as common env var settings for Bash and Zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
651
diff
changeset
|
8 |
fi |
172 | 9 |
|
180
176106ed8e46
Set prompt for shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
179
diff
changeset
|
10 |
PS1='zsh# ' |
176106ed8e46
Set prompt for shell.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
179
diff
changeset
|
11 |
|
651
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
12 |
HISTFILE=~/.zsh_history |
214 | 13 |
HISTSIZE=10000 |
14 |
SAVEHIST=10000 |
|
172 | 15 |
|
651
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
16 |
setopt AUTO_CD |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
17 |
setopt BEEP |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
18 |
setopt NOMATCH |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
19 |
setopt NOTIFY |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
20 |
|
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
21 |
setopt APPEND_HISTORY |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
22 |
setopt EXTENDED_HISTORY |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
23 |
setopt HIST_EXPIRE_DUPS_FIRST |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
24 |
setopt HIST_IGNORE_ALL_DUPS |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
25 |
setopt HIST_IGNORE_SPACE |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
26 |
setopt HIST_NO_FUNCTIONS |
177
95c784cc8cbb
History settings for zsh.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
172
diff
changeset
|
27 |
|
651
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
28 |
setopt MENUCOMPLETE |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
29 |
# Use completion cache |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
30 |
zstyle ':completion:*' use-cache on |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
31 |
zstyle ':completion:*' cache-path ~/.zsh/cache |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
32 |
|
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
33 |
# Ignore SCM revision files |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
34 |
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)(CVS|.svn|.git)' |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
35 |
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#(CVS|.svn|.git)' |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
36 |
|
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
37 |
# Fuzzy completion |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
38 |
zstyle ':completion:*' completer _expand _complete _match _approximate |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
39 |
zstyle ':completion:*:match:*' original only |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
40 |
zstyle ':completion:*:approximate:*' max-errors 1 numeric |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
41 |
|
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
42 |
# Do not attempt to complete missing commands |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
43 |
#zstyle ':completion:*:functions' ignored-patterns '_*' |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
44 |
|
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
45 |
# Complete PIDS with menu |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
46 |
zstyle ':completion:*:*:kill:*' menu yes select |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
47 |
zstyle ':completion:*:kill:*' force-list always |
172 | 48 |
|
179
ed15e30ff41a
Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
177
diff
changeset
|
49 |
autoload -U edit-command-line |
ed15e30ff41a
Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
177
diff
changeset
|
50 |
zle -N edit-command-line |
ed15e30ff41a
Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
177
diff
changeset
|
51 |
bindkey '\ee' edit-command-line |
ed15e30ff41a
Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
177
diff
changeset
|
52 |
|
172 | 53 |
# Emacs like editing. |
54 |
bindkey -e |
|
55 |
||
243
843cc9d49dc2
Enable history search.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
215
diff
changeset
|
56 |
bindkey "^[[A" history-search-backward |
843cc9d49dc2
Enable history search.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
215
diff
changeset
|
57 |
bindkey "^[[B" history-search-forward |
843cc9d49dc2
Enable history search.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
215
diff
changeset
|
58 |
|
651
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
59 |
autoload -U zutil |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
60 |
|
245 | 61 |
autoload -U compinit |
62 |
compinit |
|
63 |
||
64 |
# autoload -U promptinit |
|
65 |
# promptinit |
|
66 |
# prompt walters |
|
651
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
67 |
|
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
68 |
# Renaming with globbing |
649cbbab7ded
Add new and update old entries.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
245
diff
changeset
|
69 |
# autoload zmv |