import all my dotfiles, awesome included.
[~madcoder/dotfiles.git] / config / zsh / 10_zshopts
1 #! /bin/zsh
2
3 if test -x =dircolors; then
4     eval "`dircolors`"
5     export LS_COLORS="*.ogm=01;35:${LS_COLORS}"
6     export ZLS_COLORS=$LS_COLORS
7 fi
8
9 autoload -U is-at-least
10
11 #[ a ]##########################################################################
12 setopt aliases              # expand aliases
13 setopt all_export           # define = export
14 #setopt always_last_prompt   #
15 setopt always_to_end        # always go to end of word after completion
16 setopt append_history       # append to history, dont truncate it
17 setopt auto_cd              # do cd path if only 'path' is given as command
18 setopt auto_continue        # send SIGCONT to jobs disowned
19 setopt auto_list            # list choice on ambiguous command
20 setopt auto_menu            # show menu for completion
21 setopt no_autoname_dirs     # after foo=/absolute/path, ~foo may expand to
22                             # /absolute/path, but `%~' in prompt won't give
23                             # `~foo' until `~foo' has been used (rtfm closely)
24 setopt auto_param_keys      # remove trailing spaces after completion if needed
25 setopt auto_param_slash     # add slash for directories
26 setopt auto_pushd           # cd = pushd
27 setopt auto_remove_slash    # remove slash on dirs if word separator added
28 setopt auto_resume          # simgle word resume if possible
29
30 #[ b ]##########################################################################
31 setopt bad_pattern          # warn on bad file patterns
32 setopt bang_hist            # yeah ! expansion
33 setopt bare_glob_qual       # () is quaifier list
34 setopt no_bash_auto_list    # auto_list is sufficient, i want it on first tab
35 setopt beep                 # beep me o yeah
36 setopt no_bg_nice           # don't renice jobs in bg
37 setopt no_brace_ccl         # don't expand of {adasd}
38 setopt no_bsd_echo          # dont want BSD echo compat
39
40 #[ c ]##########################################################################
41 setopt case_glob            # case sensitive globbing
42 setopt c_bases              # understand 12#120 as 120 in base 12
43 setopt no_cdable_vars       # dont add ~ automagically
44 setopt no_chase_dots        # foo/bar/.. is foo/ even if bar is a symlink
45 setopt chase_links          # cd to a symlink is in fact cd to the true dir
46 setopt check_jobs           # check jobs on exit
47 setopt clobber              # redirection can create files
48 setopt complete_aliases     # dont replace alias before completion
49 setopt complete_in_word     # we want completion to be done from cursor in word
50 setopt correct              # try to correct command line
51 setopt no_correct_all       # don't coorect args
52 setopt no_csh_junkiehistory # csh sucks
53 setopt no_csh_junkie_loops  # want do /list/; done
54 setopt no_csh_junkie_quotes # csh quote rules sucks too
55 setopt no_csh_nullcmd       # want to keep my (READ)?NULLCMD settings
56 setopt no_csh_null_glob     # don't erase not matched globs silently
57
58 #[ d-g ]########################################################################
59 setopt no_dvorak            # use only regular (qw|az)erty
60 setopt no_emacs             # use rather bindkeys that builtin
61 setopt equals               # perform = file expansions
62 setopt no_err_exit          # don't weant to see exit status even if nonzero
63 setopt no_err_return        # no return from a function with non 0 ending cmds
64 setopt exec                 # sure we want to exec commands
65 setopt extended_glob        # #,~,^ expansion
66 setopt no_extended_history  # regular history
67 setopt no_flow_control      # ignore ^S/^Q
68 setopt function_argzero     # $0 == name of script
69 setopt glob                 # sure i want globbing
70 setopt no_global_export     # local vars are not globals one
71 setopt global_rcs           # use global rcs
72 setopt no_glob_assign       # no globbing on foo=*, use foo=(*)
73 setopt no_glob_complete     # don't generate matches and cycle through them
74 setopt no_glob_dots         # not require . in filename to be match explicitely
75 setopt no_glob_subst        # no recursive expansion
76
77 #[ h-j ]########################################################################
78 setopt hash_cmds            # do not always search through path, hash cmds
79 setopt hash_dirs            # hash directories holding commands too
80 setopt hash_list_all        # verify path hash on completion
81 setopt hist_allow_clobber   # add | to redirections in history
82 setopt no_hist_beep         # don't beep on history expansion errors
83 #setopt hist_expire_dups_first
84 setopt hist_find_no_dups    # don't show dups even if not contiguous
85 setopt hist_ignore_all_dups # ignore all -- even non contiguous -- dups
86 #setopt hist_ignore_dups     # ignore contiguous dups
87 setopt no_hist_ignore_space # historify commands with spaces too
88 setopt hist_no_functions    # don't save functions defs in history
89 setopt hist_no_store        # remove hists access cmds from hist
90 setopt hist_reduce_blanks   # remove superfluous blanks
91 setopt hist_save_no_dups    # no dups on history saving
92 setopt hist_verify          # some expansion gadget
93 setopt no_hup               # don't SIGHUP bg cmds on logout
94 setopt no_ignore_braces     # do braces expansion
95 setopt no_ignore_eof        # don't ignore ^D
96 setopt no_inc_appendhistory # dont' append incrementally
97 #setopt interactive
98 setopt interactive_comments # allow comments in interactive shell
99
100 #[ k-o ]########################################################################
101 setopt no_ksh_arrays        # don't emulate ksh arrays
102 setopt no_ksh_autoload      # don't do some dark autoload on function call
103 setopt no_ksh_glob          # ignore @ before ()
104 setopt ksh_option_print     # modify setopt output
105 setopt no_ksh_typeset       # use zsh typeset
106 setopt list_ambiguous       # unambiguous prefix completion is done silently
107 setopt no_list_beep         # don't beep for completion
108 setopt list_packed          # different width for completion
109 setopt no_list_rows_first   # sort by colums
110 setopt list_types           # show types of listing files
111 #setopt local_*              # used in functions RTFM
112 #setopt login                # don't have to do it myself
113 setopt long_list_jobs       # list jobs in long format
114 setopt magic_equal_subst    # foo= is file expanded
115 setopt no_mail_warning      # auto-explained
116 setopt mark_dirs            # adds / on dirs in filename completion
117 setopt no_menu_complete     # don't show menu on ambiguous completion
118 setopt monitor              # job control
119 setopt multios              # multi redirection allowed
120 setopt nonomatch            # do not print error on non matched patterns
121 setopt notify               # notify immediately, not on next prompt
122 setopt no_null_glob         # don't delete not matched globs
123 setopt numeric_glob_sort    # sort in numeric order rather than lexicographic
124 setopt no_octal_zeroes      # 010 = 9 sucks
125 setopt no_overstrike        # dont start le in overstrike mode
126
127 #[ p-r ]########################################################################
128 setopt path_dirs            # search in path even if cmd has '/' in it
129 setopt no_posix_builtins    # yeah don't like posix, i'm a rebel
130 setopt print_eight_bit      # just to be sure
131 #setopt privileged           #
132 setopt no_prompt_bang       # dont perform history expansion in prompt
133 setopt no_prompt_cr         # don'tprint <cr> before prompt ---> see precmd !
134 setopt prompt_percent       # expand % escapes in prompt
135 setopt prompt_subst         # subts in prompt
136 setopt pushd_ignore_dups    # ignore dups in pushd
137 #setopt pushd_minus          # exchange +/-
138 setopt pushd_silent         # don't print stack after push/pop
139 setopt pushd_to_home        # pushd == pushd $HOME
140 setopt rc_expand_param      # some expansion trick for arrays in params
141 setopt rc_quotes            # '' == ' in 'quoted exprs
142 setopt rcs                  # source all /etc rcs
143 setopt no_rec_exact         # recognize exact match even if ambiguous
144 #setopt restricted           #
145 setopt no_rm_star_silent    # ask user before rm foo/*
146 setopt no_rm_star_wait      # dont't idle 10 seconds
147
148 #[ s-z ]########################################################################
149 setopt no_share_history     # traditional bash-history
150 setopt no_sh_file_expansion # dont expand filnames first
151 setopt no_sh_glob           # allow globbing with [(|)<]
152 #setopt shin_stdin           #
153 setopt no_sh_nullcmd        # use my NULLCMD
154 setopt sh_option_letters    # interprete single option letters a la ksh
155 setopt short_loops          # short loops
156 setopt no_sh_word_split     # `s="a b"; a=($s)' => array of length 1, not 2
157 #setopt single_command       #
158 setopt no_single_line_zle   # use multiline editor
159 setopt no_sun_keyboard_hack # i don't use sun kb
160 setopt transient_rprompt    # better for cut/paste
161 #setopt typeset_silent       #
162 #setopt unset                #
163 #setopt verbose              #
164 setopt vi                   # use bindkeys
165 setopt no_xtrace            # do not debug by default
166 setopt zle                  # use zsh le
167
168 is-at-least 4.3.0 && {
169     unsetopt hist_save_by_copy
170 }
171
172 [ -w $zsh_cache ] && HISTFILE=$zsh_cache/history
173
174 HISTSIZE=10000              # size of history
175 LISTMAX=1000                # never ask
176 NULLCMD='cat'               # use cat for > null commands
177 REPORTTIME=2                # report time if execution exceeds amount of seconds
178 SAVEHIST=10000              # maximum of history events to be save
179 LOGCHECK=60
180 watch=(notme)               # watch login/logout
181 WORDCHARS="*?_-.[]~/&;!#$%^(){}<>"
182                             # part of word in line editor