summaryrefslogtreecommitdiff
path: root/global/etc/zshrc
blob: 0ad8dd374aae2314779c5eaa908d48dbc8442d2f (plain)
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
71
72
73
74
75
76
autoload -U colors && colors
autoload -U compinit && compinit

source /usr/share/git/completion/git-prompt.sh


setopt NO_BG_NICE

export EDITOR=vim
bindkey -e # workaround to avoid usage of viins

# history {{{

HISTSIZE=50000
HISTFILE=~/.history
SAVEHIST=50000

# }}}
# aliases {{{

alias ll='ls -l'
alias ls='ls --color=auto'
alias ltr='ls -tr'
alias la='ls -a'
alias l='ls -F'
alias p='mplayer'
alias h='htop'
alias m='make'
alias mb='make -B'
alias v='vim'
alias g='grep'
alias a='alsamixer'
alias b='exec $0'
alias e='echo'
alias mu='mplayer -novideo'
alias grep='grep --color=auto'
alias g='git'
alias m='make'
alias mb='make -B'
alias vi='vim'
alias k='kill'
alias r='reset'
alias pc='pacman'
alias po='pidof'
alias t='tig'

# }}}
# prompt {{{

function __set_prompt ()
{
    PS1="%{$user_color%}%n%"
    PS1+="{$fg_bold[blue]%}@"
    PS1+="%{$fg_bold[white]%}%M"
    PS1+="%{$reset_color%}:"
    PS1+="%{$fg_bold[blue]%}%~"
    PS1+="%{$reset_color%} "
    PS1+="%{$fg_bold[green]%}$(__git_ps1 "(%s) ")"
    PS1+="%{$reset_color%}%(!.#.$) "
}

if [ $UID -eq 0 ]; then
    user_color=$fg_bold[red]
else
    user_color=$fg_bold[yellow]
fi

# this function is called each time the prompt appears.
function precmd
{
    __set_prompt
}

# }}}

ulimit -c unlimited