forked from justone/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
120 lines (94 loc) · 2.97 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
##
# Zgen and Prezto
##
source "${HOME}/.local/share/zgen/zgen.zsh"
# Autoreload if .zshrc has changed
ZGEN_RESET_ON_CHANGE=("$(realpath ~/.zshrc)")
# Load zgen
if ! zgen saved; then
# Set case-sensitivity for completion, history lookup, etc.
zgen prezto "*" case-sensitive 'no'
# Color output (auto set to 'no' on dumb terminals)
zgen prezto "*" color 'yes'
# Set the key mapping style to 'emacs' or 'vi'
zgen prezto editor key-bindings 'vi'
# Auto convert .... to ../..
zgen prezto editor dot-expansion 'no'
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'
zgen prezto git:status:ignore submodules 'all'
# Override git log oneline format
zgen prezto git:log:oneline format '%C(green)%h%C(reset) -%C(yellow)%d%C(reset) %s %C(green)(%cr) %C(blue)<%an>%C(reset)'
# Auto set the tab and window titles
zgen prezto terminal auto-title 'yes'
# Unlimited history
zgen prezto history histsize '99999999'
# Set the Prezto modules to load (the order matters)
ZGEN_PREZTO_LOAD_DEFAULT=0
zgen prezto
zgen prezto archive
zgen prezto environment
zgen prezto terminal
zgen prezto editor
zgen prezto history
zgen prezto directory
zgen prezto utility
zgen prezto completion
zgen prezto prompt
zgen prezto git
zgen prezto syntax-highlighting
zgen prezto history-substring-search
# Other plugins
zgen load radhermit/gentoo-zsh-completions src
zgen load t413/zsh-background-notify
zgen load djui/alias-tips
zgen load unixorn/autoupdate-zgen
# Custom theme
zgen load ngg/zsh-prompt-cylon
zgen prezto prompt theme 'cylon'
# Save all to init script
zgen save
fi
##
# Custom options
##
setopt nonomatch # pass the unevaluated argument like bash
setopt print_exit_value
unsetopt rm_star_silent
unsetopt share_history
setopt inc_append_history
setopt glob_dots # include dotfiles in globbing
unsetopt list_beep # no bell on ambiguous completion
unsetopt hist_beep # no bell on error in history
unsetopt beep # no bell on error
unsetopt bang_hist # no history expansion on '!'
##
# Custom keys
##
# History search
bindkey "$key_info[PageUp]" history-substring-search-up
bindkey "$key_info[PageDown]" history-substring-search-down
# Open man page for current command
bindkey "^Xm" run-help
# Control + arrows to navigate words
for key in "${(s: :)key_info[ControlLeft]}"
bindkey -M viins "$key" backward-word
for key in "${(s: :)key_info[ControlRight]}"
bindkey -M viins "$key" forward-word
##
# Shared resources
##
source "$HOME/.alias"
source "$HOME/.env"
source_if_available "$HOME/.local/share/fzf/shell/completion.zsh"
source_if_available "$HOME/.local/share/fzf/shell/key-bindings.zsh"
##
# Get notified when someone logs in
##
watch=all # watch all logins
logcheck=30 # every 30 seconds
WATCHFMT="%n from %M has %a tty%l at %T %W"
##
# Misc
##
export ZSH_PLUGINS_ALIAS_TIPS_EXCLUDES="_ g"
source_if_available "$HOME/git/CoreTools/GoogleTestCompletion.sh"