Parent directory

misc.zsh

1102 bytes
 1autoload -Uz is-at-least
 2
 3# *-magic is known buggy in some versions; disable if so
 4if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
 5  for d in $fpath; do
 6    if [[ -e "$d/url-quote-magic" ]]; then
 7      if is-at-least 5.1; then
 8        autoload -Uz bracketed-paste-magic
 9        zle -N bracketed-paste bracketed-paste-magic
10      fi
11      autoload -Uz url-quote-magic
12      zle -N self-insert url-quote-magic
13    break
14    fi
15  done
16fi
17
18setopt multios              # enable redirect to multiple streams: echo >file1 >file2
19setopt long_list_jobs       # show long list format job notifications
20setopt interactivecomments  # recognize comments
21
22# define pager depending on what is available (less or more)
23if (( ${+commands[less]} )); then
24  env_default 'PAGER' 'less'
25  env_default 'LESS' '-R'
26elif (( ${+commands[more]} )); then
27  env_default 'PAGER' 'more'
28fi
29
30## super user alias
31alias _='sudo '
32
33## more intelligent acking for ubuntu users and no alias for users without ack
34if (( $+commands[ack-grep] )); then
35  alias afind='ack-grep -il'
36elif (( $+commands[ack] )); then
37  alias afind='ack -il'
38fi