]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/blob - .zshrc
add some more functions and zle widgets
[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 ~/Data/public/software/zinit/zinit.zsh
46 source "${HOME}/.zgenom/zgenom.zsh"
47 # Check for plugin and zgenom updates every 7 days
48 # This does not increase the startup time.
49 zgenom autoupdate
50
51
52 # mostly static stuff, env vars
53 # zinit load 'https://github.com/joel-porquet/zsh-dircolors-solarized'
54 # zinit load "https://github.com/greymd/tmux-xpanes"
55 zgenom load 'https://github.com/joel-porquet/zsh-dircolors-solarized'
56 zgenom load "https://github.com/greymd/tmux-xpanes"
57
58
59 # options are usually independent and standalone
60 # so they can stay at the top
61 setopt AUTO_CD
62 setopt CHASE_LINKS
63
64 setopt AUTO_NAME_DIRS
65
66 setopt BRACE_CCL
67 setopt EXTENDED_GLOB
68 setopt MARK_DIRS
69 setopt NUMERIC_GLOB_SORT
70 setopt RC_EXPAND_PARAM
71 #setopt WARN_CREATE_GLOBAL
72 setopt GLOB_DOTS
73
74 # remove previous entries from history
75 setopt HIST_IGNORE_ALL_DUPS
76 # do not write lines starting with a space to history file
77 setopt HIST_IGNORE_SPACE
78 # Remove superfluous blanks
79 setopt HIST_REDUCE_BLANKS
80 # expand history expansion for verification
81 setopt HIST_VERIFY
82 # save timestamp and runtime as well
83 setopt EXTENDED_HISTORY
84 # write line to history file when finished, not when started, to have correct runtime
85 setopt INC_APPEND_HISTORY_TIME
86
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 # zinit load 'https://github.com/zsh-users/zsh-completions'
113 zgenom load 'https://github.com/zsh-users/zsh-completions'
114
115 # initialize completion system before loading plugins and external configs
116 source ~/.zsh_comprc
117
118
119 # TODO reconsider this
120 # source /usr/share/autojump/autojump.sh
121
122
123 # autoload all functions defined by me
124 # since only filenames are required we
125 # * follow symlinks
126 # * work only on plainfiles
127 # * take only the filename part without dir
128 autoload ~/.zsh_functions/[^_]*(-.:t)
129
130
131 autoload -Uz vcs_info
132 zstyle ':vcs_info:*' enable git
133
134 # similar to xargs
135 autoload -U zargs
136
137 # similar to rename or mmv
138 autoload -U zmv
139 autoload -U zln
140 autoload -U zcp
141
142
143 # zle customization
144
145 # spawn editor on current command line
146 autoload -Uz edit-command-line
147 zle -N edit-command-line
148 bindkey -M vicmd '^X^E' edit-command-line
149 bindkey -M viins '^X^E' edit-command-line
150
151 # show globbing results live
152 autoload insert-files
153 zle -N insert-files
154 bindkey '^Xf' insert-files
155
156
157 #this mainly sets vars, binds keys, does zle stuff
158 # zinit load 'https://github.com/laurenkt/zsh-vimto'
159 zgenom load 'https://github.com/laurenkt/zsh-vimto'
160
161 # functions and an autoload, should be fine here
162 # zinit load 'https://github.com/MichaelAquilina/zsh-you-should-use'
163 zgenom load 'https://github.com/MichaelAquilina/zsh-you-should-use'
164
165
166 # source ~/.zsh_taskwarrior
167 # source ~/.zsh_functions
168 # source ~/.zsh_functions_media
169 # source ~/.zsh_functions_taskwarrior
170
171
172 for f in ~/.zsh_local*(N)
173 do
174         source $f
175 done
176
177
178 #zle -N zle-line-init
179 #zle -N zle-keymap-select
180
181
182 # keybindings might have been changed by plugins, etc.
183 # so they go more to the bottom
184
185
186 # should probably be closer to the bottom than the top?
187 # zinit load 'https://github.com/nojhan/liquidprompt'
188 zgenom load 'https://github.com/nojhan/liquidprompt'
189
190
191 # needs to be loaded close to the end because it hooks into other stuff
192 # see https://github.com/zsh-users/zsh-syntax-highlighting
193 source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
194
195 source /usr/share/doc/fzf/examples/key-bindings.zsh
196 source /usr/share/doc/fzf/examples/completion.zsh
197
198 # Use fd (https://github.com/sharkdp/fd) instead of the default find
199 # command for listing path candidates.
200 # - The first argument to the function ($1) is the base path to start traversal
201 # - See the source code (completion.{bash,zsh}) for the details.
202 _fzf_compgen_path() {
203   fdfind --hidden --follow --exclude ".git" . "$1"
204 }
205
206 # Use fd to generate the list for directory completion
207 _fzf_compgen_dir() {
208   fdfind --type d --hidden --follow --exclude ".git" . "$1"
209 }
210
211 # commands to run after initialization is complete
212 #task awaiting
213 cat ~/.motd
214 # zprof