-
Notifications
You must be signed in to change notification settings - Fork 2
/
zshrc
70 lines (61 loc) · 1.62 KB
/
zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[[ "$TERM" == "xterm" ]] && export TERM=xterm-256color
export LSCOLORS=ExCxFxFxBxGxGxababaeae
export CLICOLOR=$LSCOLORS
# history
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
# other
setopt beep notify
bindkey -e
# TitleBar setting
case $TERM in
xterm*)
precmd () {print -Pn "\e]0;[%n@%m] %~\a"}
;;
esac
# prompt
PROMPT="[%n@%m %~]%# "
# keys for freebsd
typeset -g -A key
key[F1]='^[OP'
key[F2]='^[OQ'
key[F3]='^[OR'
key[F4]='^[OS'
key[F5]='^[[15~'
key[F6]='^[[17~'
key[F7]='^[[18~'
key[F8]='^[[19~'
key[F9]='^[[20~'
key[F10]='^[[21~'
key[F11]='^[[23~'
key[F12]='^[[24~'
key[Backspace]='^?'
key[Insert]='^[[2~'
key[Home]='^[[H'
key[PageUp]='^[[5~'
key[Delete]='^[[3~'
key[End]='^[[F'
key[PageDown]='^[[6~'
key[Up]='^[[A'
key[Left]='^[[D'
key[Down]='^[[B'
key[Right]='^[[C'
key[Menu]=''
# fix lxterm
key[Home_]='^[OH'
key[End_]='^[OF'
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
#[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
#[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
#[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
#[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
# fix lxterm
[[ -n "${key[Home_]}" ]] && bindkey "${key[Home_]}" beginning-of-line
[[ -n "${key[End_]}" ]] && bindkey "${key[End_]}" end-of-line
#alias
eval $(thefuck --alias)