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