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