]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/blob - .zshrc
add function to list knot master zones
[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 setopt BRACE_CCL
66 setopt EXTENDED_GLOB
67 setopt MARK_DIRS
68 setopt NUMERIC_GLOB_SORT
69 setopt RC_EXPAND_PARAM
70 #setopt WARN_CREATE_GLOBAL
71 setopt GLOB_DOTS
72
73 # Ignore a duplicate of the previous command
74 setopt HIST_IGNORE_DUPS
75 # Do not save commands starting with a space to history
76 setopt HIST_IGNORE_SPACE
77 # Remove superfluous blanks
78 setopt HIST_REDUCE_BLANKS
79 # expand history expansion for verification
80 setopt HIST_VERIFY
81 # save timestamp and runtime as well
82 setopt EXTENDED_HISTORY
83 # write line to history file when finished, not when started, to have correct runtime
84 setopt INC_APPEND_HISTORY_TIME
85
86 # Error on a redirections which would overwrite an existing file
87 setopt NO_CLOBBER
88 setopt CORRECT
89 setopt CORRECT_ALL
90 #unsetopt NOMATCH
91 setopt PRINT_EXIT_VALUE
92
93 setopt AUTO_CONTINUE
94 setopt NO_BG_NICE
95 # display PID when suspending processes as well
96 setopt LONG_LIST_JOBS
97 # Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
98 setopt NOTIFY
99 # 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.
100 setopt HASH_LIST_ALL
101 # 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.
102 setopt COMPLETE_IN_WORD
103 # use zsh field splitting
104 setopt NO_SH_WORD_SPLIT
105 # unset parameters should cause an error
106 # CONFLICTS WITH ZINIT
107 # CONFLICTS WITH ZGENOM
108 # setopt NO_UNSET
109
110
111 # load before completion system initialization
112 zgenom load 'https://github.com/zsh-users/zsh-completions'
113
114 # initialize completion system before loading plugins and external configs
115 source ~/.zsh_comprc
116
117
118 # TODO reconsider this
119 # source /usr/share/autojump/autojump.sh
120
121
122 # autoload all functions defined by me
123 # since only filenames are required we
124 # * follow symlinks
125 # * work only on plainfiles
126 # * take only the filename part without dir
127 autoload ~/.zsh_functions/[^_]*(-.:t)
128
129
130 autoload -Uz vcs_info
131 zstyle ':vcs_info:*' enable git
132
133 # similar to xargs
134 autoload -U zargs
135
136 # similar to rename or mmv
137 autoload -U zmv
138 autoload -U zln
139 autoload -U zcp
140
141
142 # zle customization
143
144 # spawn editor on current command line
145 autoload -Uz edit-command-line
146 zle -N edit-command-line
147 bindkey -M vicmd '^X^E' edit-command-line
148 bindkey -M viins '^X^E' edit-command-line
149
150 # show globbing results live
151 autoload insert-files
152 zle -N insert-files
153 bindkey '^Xf' insert-files
154
155
156 #this mainly sets vars, binds keys, does zle stuff
157 # zgenom load 'https://github.com/laurenkt/zsh-vimto'
158
159 # functions and an autoload, should be fine here
160 zgenom load 'https://github.com/MichaelAquilina/zsh-you-should-use'
161
162
163 # source ~/.zsh_taskwarrior
164 # source ~/.zsh_functions
165 # source ~/.zsh_functions_media
166 # source ~/.zsh_functions_taskwarrior
167
168
169 for f in ~/.zsh_local*(N)
170 do
171         source $f
172 done
173
174
175 #zle -N zle-line-init
176 #zle -N zle-keymap-select
177
178
179 # keybindings might have been changed by plugins, etc.
180 # so they go more to the bottom
181
182 # the vi bindings for these do not respect WORDCHARS and are not replaced by the select-word-style functions
183 bindkey -M vicmd 'w' forward-word
184 bindkey -M vicmd 'b' backward-word
185 bindkey -M viins '^W' backward-kill-word
186
187 # default vi history search is strange
188 bindkey -M viins '^R' history-incremental-search-backward
189
190
191 # better word matching
192 autoload -U select-word-style
193 select-word-style normal
194 # these characters do _not_ separate words but are part of words
195 zstyle ':zle:*' word-chars '*?[]~;!#$%^(){}<>'
196
197
198 LP_ENABLE_TIME=1
199 # should probably be closer to the bottom than the top?
200 zgenom load 'https://github.com/nojhan/liquidprompt'
201
202
203 # needs to be loaded close to the end because it hooks into other stuff
204 # see https://github.com/zsh-users/zsh-syntax-highlighting
205 source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
206
207 source /usr/share/doc/fzf/examples/key-bindings.zsh
208 source /usr/share/doc/fzf/examples/completion.zsh
209
210 # Use fd (https://github.com/sharkdp/fd) instead of the default find
211 # command for listing path candidates.
212 # - The first argument to the function ($1) is the base path to start traversal
213 # - See the source code (completion.{bash,zsh}) for the details.
214 _fzf_compgen_path() {
215   fdfind --hidden --follow --exclude ".git" . "$1"
216 }
217
218 # Use fd to generate the list for directory completion
219 _fzf_compgen_dir() {
220   fdfind --type d --hidden --follow --exclude ".git" . "$1"
221 }
222
223 # commands to run after initialization is complete
224 #task awaiting
225 cat ~/.motd
226 # zprof