]>
Commit | Line | Data |
---|---|---|
e8abe786 | 1 | ## options |
12f46d4e | 2 | setopt autocd extendedglob |
3 | unsetopt beep | |
4 | ||
e8abe786 | 5 | ## history |
12f46d4e | 6 | setopt appendhistory |
7 | HISTFILE=~/.histfile | |
8 | HISTSIZE=100 | |
9 | SAVEHIST=100 | |
10 | ||
e8abe786 | 11 | ## keys |
12f46d4e | 12 | bindkey -v |
e8abe786 | 13 | KEYTIMEOUT=1 |
12f46d4e | 14 | # xorg |
15 | bindkey "^[[7~" beginning-of-line #Home | |
16 | bindkey -a "^[[7~" beginning-of-line | |
17 | bindkey "^[[8~" end-of-line #End | |
18 | bindkey -a "^[[8~" end-of-line | |
19 | bindkey "^[[3~" delete-char #Del | |
20 | bindkey -a "^[[3~" delete-char | |
21 | # bsd vt | |
e8abe786 | 22 | bindkey "^[[H" beginning-of-line #Home |
12f46d4e | 23 | bindkey -a "^[[H" beginning-of-line |
e8abe786 | 24 | bindkey "^[[F" end-of-line #End |
12f46d4e | 25 | bindkey -a "^[[F" end-of-line |
26 | ||
27 | autoload -Uz up-line-or-beginning-search down-line-or-beginning-search | |
28 | zle -N up-line-or-beginning-search | |
29 | zle -N down-line-or-beginning-search | |
30 | [[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search | |
31 | [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search | |
32 | ||
e8abe786 | 33 | ## aliases |
1b8a4102 | 34 | alias h="history -25" |
35 | alias j="jobs -l" | |
e8abe786 | 36 | alias l="ls -AF" |
37 | alias ll="ls -lAFho" | |
38 | local p="ps -aSdxwwouser=USR -ogroup=GRP -opid,nice=N \ | |
39 | -o%cpu,%mem,tt,stat,start=START -oetime,command | ${PAGER:-more} -Se" | |
40 | alias pa="$p" | |
41 | alias spa="sudo $p" | |
42 | unset p | |
12f46d4e | 43 | function s { sysctl hw.snd.default_unit${1:+=$1} } |
3edfaacd | 44 | alias va="source bin/activate" |
1b8a4102 | 45 | |
46 | # be paranoid | |
47 | alias cp='cp -ip' | |
48 | alias mv='mv -i' | |
49 | alias rm='rm -I' | |
50 | ||
1b8a4102 | 51 | # ports |
118fb6e0 | 52 | function portpkg { |
53 | case "$1" { | |
3edfaacd | 54 | build|run) |
55 | sudo pkg install -AU $(make ${1}-depends-list | | |
56 | sed 's_/usr/ports/_ _' | tr -d '\n') | |
57 | ;; | |
58 | *) echo "Usage: \`portpkg <build|run>' in a port directory" | |
118fb6e0 | 59 | return 1;; |
60 | } | |
118fb6e0 | 61 | } |
1b8a4102 | 62 | |
e8abe786 | 63 | ## prompt |
64 | setopt prompt_subst | |
65 | PROMPT='%F{$VICOL}%n%f@%F{$VICOL}%m%f%(?../%F{red}$?%f)%# ' | |
66 | RPROMPT='%F{yellow}${vcs_info_msg_0_:-%~}%f %T' | |
67 | ||
68 | function zle-line-init zle-keymap-select { | |
69 | VICOL="${${KEYMAP:/vicmd/red}:/(main|viins)/green}" | |
70 | zle reset-prompt | |
71 | } | |
72 | zle -N zle-line-init | |
73 | zle -N zle-keymap-select | |
74 | ||
75 | autoload -Uz vcs_info | |
76 | zstyle ':vcs_info:*' enable git | |
77 | zstyle ':vcs_info:*' get-revision true | |
78 | zstyle ':vcs_info:git*' formats "%%F{green}[%b]%m%u%c%%f %S" | |
79 | zstyle ':vcs_info:git*' actionformats "%%F{red}(%a) %%F{green}[%b]%m%u%c%%f %S" | |
80 | ||
81 | function precmd { | |
82 | print -Pn "\e]0;%(1j,%j,)%#${SSH_CLIENT+$USER@$HOST:}%~\a" | |
83 | vcs_info | |
84 | if ((SECONDS - _exectime >= 5)) { | |
85 | # bell if exec takes 5s | |
86 | print "\a" | |
87 | } | |
88 | } | |
89 | function preexec { | |
90 | # change Xorg title | |
91 | print -Pnf "\e]0;%s\a" "%#${SSH_CLIENT+$USER@$HOST:}$1" | |
92 | # save last exec time | |
93 | _exectime=$SECONDS | |
94 | } | |
95 | ||
1b8a4102 | 96 | # The following lines were added by compinstall |
97 | zstyle ':completion:*' auto-description 'specify: %d' | |
98 | zstyle ':completion:*' expand suffix | |
99 | zstyle ':completion:*' format '# %d' | |
100 | zstyle ':completion:*' group-name '' | |
101 | zstyle ':completion:*' ignore-parents parent | |
102 | zstyle ':completion:*' insert-unambiguous false | |
103 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} | |
104 | zstyle ':completion:*' list-prompt '%B%i%b' | |
105 | zstyle ':completion:*' list-suffixes true | |
106 | zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' | |
107 | zstyle ':completion:*' menu select=1 | |
108 | zstyle ':completion:*' original false | |
109 | zstyle ':completion:*' select-prompt '%B%l%b' | |
110 | zstyle ':completion:*' verbose true | |
111 | zstyle :compinstall filename '/home/ds6/.zshrc' | |
112 | ||
113 | autoload -Uz compinit | |
114 | compinit | |
115 | # End of lines added by compinstall | |
116 | ||
03bc64c4 | 117 | # vim: ts=8:sts=4:sw=4:et:tw=79 |