forked from zimfw/environment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.zsh
57 lines (46 loc) · 1.72 KB
/
init.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
# generic options and environment settings
#
# Use smart URL pasting and escaping.
autoload -Uz bracketed-paste-url-magic && zle -N bracketed-paste bracketed-paste-url-magic
autoload -Uz url-quote-magic && zle -N self-insert url-quote-magic
# Treat single word simple commands without redirection as candidates for resumption of an existing job.
setopt AUTO_RESUME
# Allow comments starting with `#` even in interactive shells.
setopt INTERACTIVE_COMMENTS
# List jobs in the long format by default.
setopt LONG_LIST_JOBS
# Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
setopt NOTIFY
# Prevent runing all background jobs at a lower priority.
setopt NO_BG_NICE
# Prevent reporting the status of background and suspended jobs before exiting a shell with job control.
# NO_CHECK_JOBS is best used only in combination with NO_HUP, else such jobs will be killed automatically.
setopt NO_CHECK_JOBS
# Prevent sending the HUP signal to running jobs when the shell exits.
setopt NO_HUP
# Remove path separtor from WORDCHARS.
WORDCHARS=${WORDCHARS//[\/]}
# Set less or more as the default pager.
if (( ! ${+PAGER} )); then
if (( ${+commands[less]} )); then
export PAGER=less
else
export PAGER=more
fi
fi
# sets the window title and updates before and after execution of commands
# more work probably needs to be done here to support multiplexers
case ${TERM} in
xterm*|*rxvt)
termtitle_update() {
local ztermtitle
if zstyle -s ':zim:environment' termtitle 'ztermtitle'; then
print -Pn "\e]0;${ztermtitle}\a"
fi
}
autoload -Uz add-zsh-hook \
&& add-zsh-hook precmd termtitle_update \
&& add-zsh-hook preexec termtitle_update
;;
esac