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