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