]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/blob - .zshrc
unset and comment strange option
[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 # print time needed for execution when it takes longer than this value
13 REPORTTIME=10
14
15
16 ## define word characters (for stuff like backward-word, forward-word, backward-kill-word,..)
17 ## these are NOT separators but chars considered part of a word
18 ## these are NOT respected by e.g. vi-backward-kill-word, it seems
19 # WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
20 ## see below how to solve this with select-word-style module
21
22
23 # where zsh looks for functions
24
25 # add my own functions
26 fpath=(~/.zsh_functions $fpath)
27
28
29 # hashed directories are usually independent and standalone
30 # so they can stay at the top
31 hash -d diary=~/Data/personal/henk/workinprogress/Dokumente/diary
32 hash -d lifedocs=~/Data/personal/henk/workinprogress/Dokumente/Leben
33 hash -d bewerbung=~/Data/personal/henk/workinprogress/Dokumente/Arbeit/bewerbung
34 hash -d rezepte=~/Data/personal/henk/workinprogress/Dokumente/rezepte/cuisine
35 hash -d templates=~/Data/personal/henk/workinprogress/templates
36 hash -d gitignore=~/Data/public/software/gitignore
37 hash -d doc=/usr/share/doc
38 hash -d TODO=~/Data/personal/henk/TODO/
39 hash -d fortunes=~/Data/personal/henk/workinprogress/Dokumente/fortunes/
40
41
42 # aliases are usually independent and standalone
43 source ~/.zsh_aliases
44
45
46 # load plugin manager after all 'static' stuff is done
47 source "${HOME}/.zgenom/zgenom.zsh"
48 # Check for plugin and zgenom updates every 7 days
49 # This does not increase the startup time.
50 zgenom autoupdate
51
52
53 # mostly static stuff, env vars
54 zgenom load 'https://github.com/joel-porquet/zsh-dircolors-solarized'
55 zgenom load "https://github.com/greymd/tmux-xpanes"
56
57
58 # options are usually independent and standalone
59 # so they can stay at the top
60 setopt AUTO_CD
61 setopt CHASE_LINKS
62
63 setopt AUTO_NAME_DIRS
64
65 # this should not be needed ever
66 # unclear why it is even implemented
67 # all relevant functionality should be possible without this anyway
68 # see #zsh@libera on 2024-04-14
69 # setopt BRACE_CCL
70 setopt EXTENDED_GLOB
71 setopt MARK_DIRS
72 setopt NUMERIC_GLOB_SORT
73 setopt RC_EXPAND_PARAM
74 #setopt WARN_CREATE_GLOBAL
75 setopt GLOB_DOTS
76
77 # Ignore a duplicate of the previous command
78 setopt HIST_IGNORE_DUPS
79 # Do not save commands starting with a space to history
80 setopt HIST_IGNORE_SPACE
81 # Remove superfluous blanks
82 setopt HIST_REDUCE_BLANKS
83 # expand history expansion for verification
84 setopt HIST_VERIFY
85 # save timestamp and runtime as well
86 setopt EXTENDED_HISTORY
87 # write line to history file when finished, not when started, to have correct runtime
88 setopt INC_APPEND_HISTORY_TIME
89
90 # Error on a redirections which would overwrite an existing file
91 setopt NO_CLOBBER
92 setopt CORRECT
93 setopt CORRECT_ALL
94 #unsetopt NOMATCH
95 setopt PRINT_EXIT_VALUE
96
97 setopt AUTO_CONTINUE
98 setopt NO_BG_NICE
99 # display PID when suspending processes as well
100 setopt LONG_LIST_JOBS
101 # Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
102 setopt NOTIFY
103 # 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.
104 setopt HASH_LIST_ALL
105 # 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.
106 setopt COMPLETE_IN_WORD
107 # use zsh field splitting
108 setopt NO_SH_WORD_SPLIT
109 # unset parameters should cause an error
110 # CONFLICTS WITH ZINIT
111 # CONFLICTS WITH ZGENOM
112 # setopt NO_UNSET
113
114
115 # load before completion system initialization
116 zgenom load 'https://github.com/zsh-users/zsh-completions'
117
118 # initialize completion system before loading plugins and external configs
119 source ~/.zsh_comprc
120
121
122 # TODO reconsider this
123 # source /usr/share/autojump/autojump.sh
124
125
126 # autoload all functions defined by me
127 # since only filenames are required we
128 # * follow symlinks
129 # * work only on plainfiles
130 # * take only the filename part without dir
131 autoload ~/.zsh_functions/[^_]*(-.:t)
132
133
134 autoload -Uz vcs_info
135 zstyle ':vcs_info:*' enable git
136
137 # similar to xargs
138 autoload -U zargs
139
140 # similar to rename or mmv
141 autoload -U zmv
142 autoload -U zln
143 autoload -U zcp
144
145
146 # zle customization
147
148 # spawn editor on current command line
149 autoload -Uz edit-command-line
150 zle -N edit-command-line
151 bindkey -M vicmd '^X^E' edit-command-line
152 bindkey -M viins '^X^E' edit-command-line
153
154 # show globbing results live
155 autoload insert-files
156 zle -N insert-files
157 bindkey '^Xf' insert-files
158
159
160 #this mainly sets vars, binds keys, does zle stuff
161 # zgenom load 'https://github.com/laurenkt/zsh-vimto'
162
163 # functions and an autoload, should be fine here
164 zgenom load 'https://github.com/MichaelAquilina/zsh-you-should-use'
165
166
167 # source ~/.zsh_taskwarrior
168 # source ~/.zsh_functions
169 # source ~/.zsh_functions_media
170 # source ~/.zsh_functions_taskwarrior
171
172
173 for f in ~/.zsh_local*(N)
174 do
175         source $f
176 done
177
178
179 #zle -N zle-line-init
180 #zle -N zle-keymap-select
181
182
183 # keybindings might have been changed by plugins, etc.
184 # so they go more to the bottom
185
186 # the vi bindings for these do not respect WORDCHARS and are not replaced by the select-word-style functions
187 bindkey -M vicmd 'w' forward-word
188 bindkey -M vicmd 'b' backward-word
189 bindkey -M viins '^W' backward-kill-word
190
191 # default vi history search is strange
192 bindkey -M viins '^R' history-incremental-search-backward
193
194
195 # better word matching
196 autoload -U select-word-style
197 select-word-style normal
198 # these characters do _not_ separate words but are part of words
199 zstyle ':zle:*' word-chars '*?[]~;!#$%^(){}<>'
200
201
202 LP_ENABLE_TIME=1
203 # should probably be closer to the bottom than the top?
204 zgenom load 'https://github.com/nojhan/liquidprompt'
205
206
207 # needs to be loaded close to the end because it hooks into other stuff
208 # see https://github.com/zsh-users/zsh-syntax-highlighting
209 source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
210
211 source /usr/share/doc/fzf/examples/key-bindings.zsh
212 source /usr/share/doc/fzf/examples/completion.zsh
213
214 # Use fd (https://github.com/sharkdp/fd) instead of the default find
215 # command for listing path candidates.
216 # - The first argument to the function ($1) is the base path to start traversal
217 # - See the source code (completion.{bash,zsh}) for the details.
218 _fzf_compgen_path() {
219   fdfind --hidden --follow --exclude ".git" . "$1"
220 }
221
222 # Use fd to generate the list for directory completion
223 _fzf_compgen_dir() {
224   fdfind --type d --hidden --follow --exclude ".git" . "$1"
225 }
226
227 # commands to run after initialization is complete
228 #task awaiting
229 cat ~/.motd
230 # zprof