]> git.sev.monster Git - dotfiles.git/blame - base/.zshrc
added syncthing script, more dirs to install
[dotfiles.git] / base / .zshrc
CommitLineData
e8abe786 1## options
12f46d4e 2setopt autocd extendedglob
3unsetopt beep
4
e8abe786 5## history
12f46d4e 6setopt appendhistory
7HISTFILE=~/.histfile
8HISTSIZE=100
9SAVEHIST=100
10
e8abe786 11## keys
12f46d4e 12bindkey -v
e8abe786 13KEYTIMEOUT=1
12f46d4e 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
e8abe786 22bindkey "^[[H" beginning-of-line #Home
12f46d4e 23bindkey -a "^[[H" beginning-of-line
e8abe786 24bindkey "^[[F" end-of-line #End
12f46d4e 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
e8abe786 33## aliases
1b8a4102 34alias h="history -25"
35alias j="jobs -l"
e8abe786 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
12f46d4e 43function s { sysctl hw.snd.default_unit${1:+=$1} }
3edfaacd 44alias va="source bin/activate"
ab4fdc87 45alias vd="deactivate"
1b8a4102 46
47# be paranoid
48alias cp='cp -ip'
49alias mv='mv -i'
50alias rm='rm -I'
51
1b8a4102 52# ports
118fb6e0 53function portpkg {
54 case "$1" {
3edfaacd 55 build|run)
56 sudo pkg install -AU $(make ${1}-depends-list |
57 sed 's_/usr/ports/_ _' | tr -d '\n')
58 ;;
59 *) echo "Usage: \`portpkg <build|run>' in a port directory"
118fb6e0 60 return 1;;
61 }
118fb6e0 62}
1b8a4102 63
e8abe786 64## prompt
65setopt prompt_subst
a922ca19 66PROMPT='%F{$VICOL}%n%f@%F{$VICOL}%2m%f%(?../%F{red}$?%f)%# '
e8abe786 67RPROMPT='%F{yellow}${vcs_info_msg_0_:-%~}%f %T'
68
69function zle-line-init zle-keymap-select {
70 VICOL="${${KEYMAP:/vicmd/red}:/(main|viins)/green}"
71 zle reset-prompt
72}
73zle -N zle-line-init
74zle -N zle-keymap-select
75
76autoload -Uz vcs_info
77zstyle ':vcs_info:*' enable git
64fa2e87 78zstyle ':vcs_info:git*' formats "%c%u%%F{green}%r/%b%%f/%%F{yellow}%S%%f"
79zstyle ':vcs_info:git*' actionformats "%%F{red}(%a)%%f %c%u%%F{green}%r/%b%%f/\
5fcc549b 80%%F{yellow}%S%%f"
a6e5a638 81#zstyle ':vcs_info:git*' check-for-changes true #too slow
82zstyle ':vcs_info:git*' check-for-staged-changes true
83zstyle ':vcs_info:git*' stagedstr "%F{blue}+"
84zstyle ':vcs_info:git*' unstagedstr "%F{red}*"
e8abe786 85
86function precmd {
87 print -Pn "\e]0;%(1j,%j,)%#${SSH_CLIENT+$USER@$HOST:}%~\a"
88 vcs_info
89 if ((SECONDS - _exectime >= 5)) {
90 # bell if exec takes 5s
91 print "\a"
92 }
93}
94function preexec {
95 # change Xorg title
96 print -Pnf "\e]0;%s\a" "%#${SSH_CLIENT+$USER@$HOST:}$1"
97 # save last exec time
98 _exectime=$SECONDS
99}
100
1b8a4102 101# The following lines were added by compinstall
102zstyle ':completion:*' auto-description 'specify: %d'
103zstyle ':completion:*' expand suffix
104zstyle ':completion:*' format '# %d'
105zstyle ':completion:*' group-name ''
106zstyle ':completion:*' ignore-parents parent
107zstyle ':completion:*' insert-unambiguous false
108zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
109zstyle ':completion:*' list-prompt '%B%i%b'
110zstyle ':completion:*' list-suffixes true
111zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
112zstyle ':completion:*' menu select=1
113zstyle ':completion:*' original false
114zstyle ':completion:*' select-prompt '%B%l%b'
115zstyle ':completion:*' verbose true
116zstyle :compinstall filename '/home/ds6/.zshrc'
117
118autoload -Uz compinit
119compinit
120# End of lines added by compinstall
121
03bc64c4 122# vim: ts=8:sts=4:sw=4:et:tw=79
This page took 0.042914 seconds and 4 git commands to generate.