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