-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
executable file
·106 lines (87 loc) · 3.81 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
# always find dotfile repo
export DOTFILESDIR="/Users/ccauet/Repositories/dotfiles"
# load additional configurations
source "${DOTFILESDIR}/zsh/aliases"
source "${DOTFILESDIR}/zsh/path"
source "${DOTFILESDIR}/zsh/prompt"
# if secret config exists, use it
if [ -f "${HOME}/.zsh_secret" ]; then
source "${HOME}/.zsh_secret"
fi
# add zsh online help
unalias run-help &>/dev/null
autoload run-help
HELPDIR=/usr/local/share/zsh/help
# enable vim mode
set -o vi
export EDITOR=vim
export VISUAL=vim
# key bindings
bindkey '^R' history-incremental-pattern-search-backward
# poetry tab completion
fpath+="${HOME}/.zfunc"
# completion
autoload -U compinit
compinit
zmodload -i zsh/complist
setopt hash_list_all # hash everything before completion
setopt completealiases # complete alisases
setopt always_to_end # when completing from the middle of a word, move the cursor to the end of the word
setopt complete_in_word # allow completion from within a word/phrase
setopt correct # spelling correction for commands
setopt list_ambiguous # complete as much of a completion until it gets ambiguous.
zstyle ':completion::complete:*' use-cache on # completion caching, use rehash to clear
zstyle ':completion:*' cache-path ~/.zsh/cache # cache path
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # ignore case
zstyle ':completion:*' menu select=2 # menu if nb items > 2
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} # colorz !
zstyle ':completion:*::::' completer _expand _complete _ignored _approximate # list of completers to use
# sections completion !
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format $'\e[00;34m%d'
zstyle ':completion:*:messages' format $'\e[00;31m%d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:processes' command 'ps -au$USER'
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=29=34"
zstyle ':completion:*:*:killall:*' menu yes select
zstyle ':completion:*:killall:*' force-list always
#generic completion with --help
compdef _gnu_generic gcc
compdef _gnu_generic gdb
# history
HISTFILE=~/.zsh_history # where to store zsh config
HISTSIZE=16384 # big history
SAVEHIST=16384 # big history
setopt append_history # append
setopt hist_ignore_all_dups # no duplicate
unsetopt hist_ignore_space # ignore space prefixed commands
setopt hist_reduce_blanks # trim blanks
setopt hist_verify # show before executing history commands
setopt inc_append_history # add commands as they are typed, don't wait until shell exit
setopt share_history # share hist between sessions
setopt bang_hist # !keyword
# misc
setopt extended_glob # activate complex pattern globbing
setopt glob_dots # include dotfiles in globbing
unsetopt beep # no bell on error
unsetopt bg_nice # no lower prio for background jobs
unsetopt hist_beep # no bell on error in history
unsetopt hup # no hup signal at shell exit
unsetopt ignore_eof # do not exit on end-of-file
unsetopt list_beep # no bell on ambiguous completion
unsetopt rm_star_silent # ask for confirmation for `rm *' or `rm path/*'
setopt AUTO_CD # if command is a path, cd into it
print -Pn "\e]0; %n@%M: %~\a" # terminal title
# History search
# stty -ixon
# define gpg
export GPG_TTY=$(tty)
# pyenv
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# mattermost CLI
# source <(mmctl completion zsh)