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