]> git.sev.monster Git - dotfiles.git/blame_incremental - base/.zshrc
fixed install.sh on gnu/busybox/android
[dotfiles.git] / base / .zshrc
... / ...
CommitLineData
1## options
2setopt autocd extendedglob
3unsetopt beep
4
5## history
6setopt appendhistory
7HISTFILE=~/.histfile
8HISTSIZE=100
9SAVEHIST=100
10
11## keys
12bindkey -v
13KEYTIMEOUT=1
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
22bindkey "^[[H" beginning-of-line #Home
23bindkey -a "^[[H" beginning-of-line
24bindkey "^[[F" end-of-line #End
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
33## aliases
34alias h="history -25"
35alias j="jobs -l"
36alias l="ls -AF"
37alias ll="ls -lAFho"
38# ps
39local p="ps -aSdxwwouser=USR -ogroup=GRP -opid,nice=N \
40 -o%cpu,%mem,tt,stat,start=START -oetime,command | ${PAGER:-more} -Se"
41alias pa="$p"
42alias spa="sudo $p"
43unset p
44# sound source
45function s { sysctl hw.snd.default_unit${1:+=$1} }
46# py venv
47alias va="source bin/activate"
48alias vd="deactivate"
49# be paranoid
50alias cp='cp -ip'
51alias mv='mv -i'
52alias rm='rm -I'
53# ports
54function portpkg {
55 case "$1" {
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"
61 return 1;;
62 }
63}
64
65## prompt
66setopt prompt_subst
67PROMPT='%F{$VICOL}%n%f@%F{$VICOL}%2m%f%(?../%F{red}$?%f)%# '
68RPROMPT='%F{yellow}${vcs_info_msg_0_:-%~}%f %T'
69
70function zle-line-init zle-keymap-select {
71 VICOL="${${KEYMAP:/vicmd/red}:/(main|viins)/green}"
72 zle reset-prompt
73}
74zle -N zle-line-init
75zle -N zle-keymap-select
76
77autoload -Uz vcs_info
78zstyle ':vcs_info:*' enable git
79zstyle ':vcs_info:git*' formats "%c%u%%F{green}%r/%b%%f/%%F{yellow}%S%%f"
80zstyle ':vcs_info:git*' actionformats "%%F{red}(%a)%%f %c%u%%F{green}%r/%b%%f/\
81%%F{yellow}%S%%f"
82#zstyle ':vcs_info:git*' check-for-changes true #too slow
83zstyle ':vcs_info:git*:.dotfiles' check-for-changes true
84zstyle ':vcs_info:git*' check-for-staged-changes true
85zstyle ':vcs_info:git*' stagedstr "%F{blue}+"
86zstyle ':vcs_info:git*' unstagedstr "%F{red}*"
87
88function 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}
96function 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
103# The following lines were added by compinstall
104zstyle ':completion:*' auto-description 'specify: %d'
105zstyle ':completion:*' expand suffix
106zstyle ':completion:*' format '# %d'
107zstyle ':completion:*' group-name ''
108zstyle ':completion:*' ignore-parents parent
109zstyle ':completion:*' insert-unambiguous false
110zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
111zstyle ':completion:*' list-prompt '%B%i%b'
112zstyle ':completion:*' list-suffixes true
113zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
114zstyle ':completion:*' menu select=1
115zstyle ':completion:*' original false
116zstyle ':completion:*' select-prompt '%B%l%b'
117zstyle ':completion:*' verbose true
118zstyle :compinstall filename '/home/ds6/.zshrc'
119
120autoload -Uz compinit
121compinit
122# End of lines added by compinstall
123
124# vim: ts=8:sts=4:sw=4:et:tw=79
This page took 0.04181 seconds and 4 git commands to generate.