]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/blob - .zshrc
add: standard zsh config files to not ignore
[user/henk/vcsh/zsh.git] / .zshrc
1 # zprof only makes sense at the very top
2 # zmodload zsh/zprof
3
4
5 # exports are usually independent and standalone
6 # so they can stay at the top
7
8 # where to write history
9 export HISTFILE=~/.zsh_history
10 export HISTSIZE=1000000000
11 export SAVEHIST=1000000000
12
13 export ANSIBLE_NOCOWS=1
14 export ANSIBLE_STRATEGY=mitogen_linear
15
16 export TEXMFCNF=${HOME}/.texlive:
17
18 export FZF_DEFAULT_COMMAND='fdfind --type f'
19
20 # what is that for exactly? maybe taskwarrior? or timewarrior?
21 REPORTTIME=10
22
23 ## define word characters (for stuff like backward-word, forward-word, backward-kill-word,..)
24 ## these are NOT separators but chars considered part of a word
25 #WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
26
27 # zsh you-should-use
28 export YSU_MODE=ALL
29
30 # I want sbin executables available
31 export PATH=${PATH}:/usr/local/sbin:/sbin:/usr/sbin
32 export PATH=${PATH}:~/bin
33
34 # colors for newt/whiptail (for debconf, needrestart, etc.)
35 # works better with selenized colorscheme
36 # everything that seems irrelevant is set to brown
37 NEWT_COLORS=''
38 # foreground seems irrelevant
39 NEWT_COLORS="${NEWT_COLORS};root=brown,blue"
40 # text in the root window
41 NEWT_COLORS="${NEWT_COLORS};roottext=yellow,blue"
42
43 # box/window/button shadows
44 NEWT_COLORS="${NEWT_COLORS};shadow=brown,black"
45
46 # boxes/windows themselves
47 NEWT_COLORS="${NEWT_COLORS};window=brown,lightgray"
48 # box/window titles
49 NEWT_COLORS="${NEWT_COLORS};title=yellow,lightgray"
50 # box/window borders
51 NEWT_COLORS="${NEWT_COLORS};border=gray,lightgray"
52
53 # full buttons
54 NEWT_COLORS="${NEWT_COLORS};button=black,red"
55 # compact buttons
56 NEWT_COLORS="${NEWT_COLORS};compactbutton=black,lightgray"
57 # selected/active button
58 NEWT_COLORS="${NEWT_COLORS};actbutton=green,gray"
59
60 # checkbox itself and text
61 NEWT_COLORS="${NEWT_COLORS};checkbox=black,blue"
62 # selection marker for checkbox
63 NEWT_COLORS="${NEWT_COLORS};actcheckbox=yellow,gray"
64
65 # TODO FIXME: no clue what that is
66 NEWT_COLORS="${NEWT_COLORS};entry=yellow,brown"
67 # TODO FIXME: no clue what that is
68 NEWT_COLORS="${NEWT_COLORS};disentry=brown,yellow"
69
70 # TODO FIXME: no clue what that is
71 NEWT_COLORS="${NEWT_COLORS};label=yellow,red"
72
73 # unselected entries in menus
74 NEWT_COLORS="${NEWT_COLORS};listbox=lightgray,gray"
75 # selected entries in menus
76 NEWT_COLORS="${NEWT_COLORS};actsellistbox=yellow,blue"
77 # TODO FIXME: no clue what that is
78 NEWT_COLORS="${NEWT_COLORS};actlistbox=brown,red"
79 # TODO FIXME: no clue what that is
80 NEWT_COLORS="${NEWT_COLORS};sellistbox=black,brown"
81
82 NEWT_COLORS="${NEWT_COLORS};textbox=black,lightgray"
83 NEWT_COLORS="${NEWT_COLORS};acttextbox=brown,green"
84
85 # TODO FIXME: no clue what that is
86 NEWT_COLORS="${NEWT_COLORS};helpline=yellow,brown"
87
88 # probably for gauges
89 NEWT_COLORS="${NEWT_COLORS};emptyscale=red"
90 NEWT_COLORS="${NEWT_COLORS};fullscale=blue"
91
92 export NEWT_COLORS
93
94 # black
95 # darkgray
96 # brown
97 # yellow
98 #
99 # blue
100 # cyan
101 # gray
102 # green
103 # magenta
104 # red
105 #
106 # lightblue
107 # lightcyan
108 # lightgray
109 # lightgreen
110 # lightmagenta
111 # lightred
112
113
114 # where zsh looks for functions
115 fpath=(~/.zsh_functions $fpath)
116
117
118 # hashed directories are usually independent and standalone
119 # so they can stay at the top
120 hash -d diary=~/Data/henksfiles/workinprogress/Dokumente/diary
121 hash -d lifedocs=~/Data/henksfiles/workinprogress/Dokumente/Leben
122 hash -d bewerbung=~/Data/personal/henk/workinprogress/Dokumente/Arbeit/bewerbung
123 hash -d rezepte=~/Data/henksfiles/workinprogress/Dokumente/rezepte/cuisine
124 hash -d templates=~/Data/henksfiles/workinprogress/templates
125 hash -d gitignore=~/Data/public/software/gitignore
126 hash -d doc=/usr/share/doc
127 hash -d TODO=~/Data/henksfiles/TODO/
128 hash -d fortunes=~/Data/henksfiles/workinprogress/Dokumente/fortunes/
129
130
131 # aliases are usually independent and standalone
132 source ~/.zsh_aliases
133 # TODO break this up or make functions or get rid?
134 source ~/.zsh_qemu
135
136
137 # load plugin manager after all 'static' stuff is done
138 # source ~/Data/public/software/zinit/zinit.zsh
139 source "${HOME}/.zgenom/zgenom.zsh"
140 # Check for plugin and zgenom updates every 7 days
141 # This does not increase the startup time.
142 zgenom autoupdate
143
144
145 # mostly static stuff, env vars
146 # zinit load 'https://github.com/joel-porquet/zsh-dircolors-solarized'
147 # zinit load "https://github.com/greymd/tmux-xpanes"
148 zgenom load 'https://github.com/joel-porquet/zsh-dircolors-solarized'
149 zgenom load "https://github.com/greymd/tmux-xpanes"
150
151
152 # options are usually independent and standalone
153 # so they can stay at the top
154 setopt AUTO_CD
155 setopt CHASE_LINKS
156
157 setopt AUTO_NAME_DIRS
158
159 setopt BRACE_CCL
160 setopt EXTENDED_GLOB
161 setopt MARK_DIRS
162 setopt NUMERIC_GLOB_SORT
163 setopt RC_EXPAND_PARAM
164 #setopt WARN_CREATE_GLOBAL
165 setopt GLOB_DOTS
166
167 # remove previous entries from history
168 setopt HIST_IGNORE_ALL_DUPS
169 # do not write lines starting with a space to history file
170 setopt HIST_IGNORE_SPACE
171 # Remove superfluous blanks
172 setopt HIST_REDUCE_BLANKS
173 # expand history expansion for verification
174 setopt HIST_VERIFY
175 # save timestamp and runtime as well
176 setopt EXTENDED_HISTORY
177 # write line to history file when finished, not when started, to have correct runtime
178 setopt INC_APPEND_HISTORY_TIME
179
180 setopt NO_CLOBBER
181 setopt CORRECT
182 setopt CORRECT_ALL
183 #unsetopt NOMATCH
184 setopt PRINT_EXIT_VALUE
185
186 setopt AUTO_CONTINUE
187 setopt NO_BG_NICE
188 # display PID when suspending processes as well
189 setopt LONG_LIST_JOBS
190 # Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
191 setopt NOTIFY
192 # Whenever  a  command completion or spelling correction is attempted, make sure the entire command path is hashed first.  This makes the first completion slower but avoids false reports of spelling errors.
193 setopt HASH_LIST_ALL
194 # If unset, the cursor is set to the end of the word if completion is started. Otherwise it stays there and completion is done from both ends.
195 setopt COMPLETE_IN_WORD
196 # use zsh field splitting
197 setopt NO_SH_WORD_SPLIT
198 # unset parameters should cause an error
199 # CONFLICTS WITH ZINIT
200 # CONFLICTS WITH ZGENOM
201 # setopt NO_UNSET
202
203
204 # load before completion system initialization
205 # zinit load 'https://github.com/zsh-users/zsh-completions'
206 zgenom load 'https://github.com/zsh-users/zsh-completions'
207
208 # initialize completion system before loading plugins and external configs
209 source ~/.zsh_comprc
210
211
212 # TODO reconsider this
213 # source /usr/share/autojump/autojump.sh
214
215
216 # autoload all functions defined by me
217 # since only filenames are required we
218 # * follow symlinks
219 # * work only on plainfiles
220 # * take only the filename part without dir
221 autoload ~/.zsh_functions/[^_]*(-.:t)
222
223
224 autoload -Uz vcs_info
225 autoload -Uz zcalc
226 autoload -Uz zargs
227
228
229 # spawn editor on current command line
230 autoload -Uz edit-command-line
231 zle -N edit-command-line
232 bindkey -M vicmd '^X^E' edit-command-line
233 bindkey -M viins '^X^E' edit-command-line
234
235
236 #this mainly sets vars, binds keys, does zle stuff
237 # zinit load 'https://github.com/laurenkt/zsh-vimto'
238 zgenom load 'https://github.com/laurenkt/zsh-vimto'
239
240 # functions and an autoload, should be fine here
241 # zinit load 'https://github.com/MichaelAquilina/zsh-you-should-use'
242 zgenom load 'https://github.com/MichaelAquilina/zsh-you-should-use'
243
244
245 # source ~/.zsh_taskwarrior
246 # source ~/.zsh_functions
247 # source ~/.zsh_functions_media
248 # source ~/.zsh_functions_taskwarrior
249
250
251 # TODO break this up
252 source ~/.zsh_local
253
254 # TODO break this up
255 for f in ~/.env_*(N)
256 do
257         source $f
258 done
259
260
261 typeset -U path
262
263 #zle -N zle-line-init
264 #zle -N zle-keymap-select
265
266
267 # keybindings might have been changed by plugins, etc.
268 # so they go more to the bottom
269
270
271 # should probably be closer to the bottom than the top?
272 # zinit load 'https://github.com/nojhan/liquidprompt'
273 zgenom load 'https://github.com/nojhan/liquidprompt'
274
275
276 # needs to be loaded close to the end because it hooks into other stuff
277 # see https://github.com/zsh-users/zsh-syntax-highlighting
278 source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
279
280 source /usr/share/doc/fzf/examples/key-bindings.zsh
281 source /usr/share/doc/fzf/examples/completion.zsh
282
283 # Use fd (https://github.com/sharkdp/fd) instead of the default find
284 # command for listing path candidates.
285 # - The first argument to the function ($1) is the base path to start traversal
286 # - See the source code (completion.{bash,zsh}) for the details.
287 _fzf_compgen_path() {
288   fdfind --hidden --follow --exclude ".git" . "$1"
289 }
290
291 # Use fd to generate the list for directory completion
292 _fzf_compgen_dir() {
293   fdfind --type d --hidden --follow --exclude ".git" . "$1"
294 }
295
296 # commands to run after initialization is complete
297 #task awaiting
298 cat ~/.motd
299 # zprof