1 # zprof only makes sense at the very top
5 # settings for the zsh don’t get exported
7 # where to write history
8 HISTFILE=~/.zsh_history
12 # print time needed for execution when it takes longer than this value
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
23 # where zsh looks for functions
25 # add my own functions
26 fpath=(~/.zsh_functions $fpath)
29 # hashed directories are usually independent and standalone
30 # so they can stay at the top
31 hash -d diary=~/Data/henksfiles/workinprogress/Dokumente/diary
32 hash -d lifedocs=~/Data/henksfiles/workinprogress/Dokumente/Leben
33 hash -d bewerbung=~/Data/personal/henk/workinprogress/Dokumente/Arbeit/bewerbung
34 hash -d rezepte=~/Data/henksfiles/workinprogress/Dokumente/rezepte/cuisine
35 hash -d templates=~/Data/henksfiles/workinprogress/templates
36 hash -d gitignore=~/Data/public/software/gitignore
37 hash -d doc=/usr/share/doc
38 hash -d TODO=~/Data/henksfiles/TODO/
39 hash -d fortunes=~/Data/henksfiles/workinprogress/Dokumente/fortunes/
42 # aliases are usually independent and standalone
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.
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"
58 # options are usually independent and standalone
59 # so they can stay at the top
68 setopt NUMERIC_GLOB_SORT
69 setopt RC_EXPAND_PARAM
70 #setopt WARN_CREATE_GLOBAL
73 # remove previous entries from history
74 setopt HIST_IGNORE_ALL_DUPS
75 # do not write lines starting with a space to history file
76 setopt HIST_IGNORE_SPACE
77 # Remove superfluous blanks
78 setopt HIST_REDUCE_BLANKS
79 # expand history expansion for verification
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
90 setopt PRINT_EXIT_VALUE
94 # display PID when suspending processes as well
96 # Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
98 # 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 # 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.
101 setopt COMPLETE_IN_WORD
102 # use zsh field splitting
103 setopt NO_SH_WORD_SPLIT
104 # unset parameters should cause an error
105 # CONFLICTS WITH ZINIT
106 # CONFLICTS WITH ZGENOM
110 # load before completion system initialization
111 zgenom load 'https://github.com/zsh-users/zsh-completions'
113 # initialize completion system before loading plugins and external configs
117 # TODO reconsider this
118 # source /usr/share/autojump/autojump.sh
121 # autoload all functions defined by me
122 # since only filenames are required we
124 # * work only on plainfiles
125 # * take only the filename part without dir
126 autoload ~/.zsh_functions/[^_]*(-.:t)
129 autoload -Uz vcs_info
130 zstyle ':vcs_info:*' enable git
135 # similar to rename or mmv
143 # spawn editor on current command line
144 autoload -Uz edit-command-line
145 zle -N edit-command-line
146 bindkey -M vicmd '^X^E' edit-command-line
147 bindkey -M viins '^X^E' edit-command-line
149 # show globbing results live
150 autoload insert-files
152 bindkey '^Xf' insert-files
155 #this mainly sets vars, binds keys, does zle stuff
156 # zgenom load 'https://github.com/laurenkt/zsh-vimto'
158 # functions and an autoload, should be fine here
159 zgenom load 'https://github.com/MichaelAquilina/zsh-you-should-use'
162 # source ~/.zsh_taskwarrior
163 # source ~/.zsh_functions
164 # source ~/.zsh_functions_media
165 # source ~/.zsh_functions_taskwarrior
168 for f in ~/.zsh_local*(N)
174 #zle -N zle-line-init
175 #zle -N zle-keymap-select
178 # keybindings might have been changed by plugins, etc.
179 # so they go more to the bottom
181 # the vi bindings for these do not respect WORDCHARS and are not replaced by the select-word-style functions
182 bindkey -M vicmd 'w' forward-word
183 bindkey -M vicmd 'b' backward-word
184 bindkey -M viins '^W' backward-kill-word
186 # default vi history search is strange
187 bindkey -M viins '^R' history-incremental-search-backward
190 # better word matching
191 autoload -U select-word-style
192 select-word-style normal
193 # these characters do _not_ separate words but are part of words
194 zstyle ':zle:*' word-chars '*?[]~;!#$%^(){}<>'
198 # should probably be closer to the bottom than the top?
199 zgenom load 'https://github.com/nojhan/liquidprompt'
202 # needs to be loaded close to the end because it hooks into other stuff
203 # see https://github.com/zsh-users/zsh-syntax-highlighting
204 source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
206 source /usr/share/doc/fzf/examples/key-bindings.zsh
207 source /usr/share/doc/fzf/examples/completion.zsh
209 # Use fd (https://github.com/sharkdp/fd) instead of the default find
210 # command for listing path candidates.
211 # - The first argument to the function ($1) is the base path to start traversal
212 # - See the source code (completion.{bash,zsh}) for the details.
213 _fzf_compgen_path() {
214 fdfind --hidden --follow --exclude ".git" . "$1"
217 # Use fd to generate the list for directory completion
219 fdfind --type d --hidden --follow --exclude ".git" . "$1"
222 # commands to run after initialization is complete