-
Notifications
You must be signed in to change notification settings - Fork 2
/
.zshrc
111 lines (88 loc) · 2.94 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Vim Mode
bindkey -v
#==============================================================================
# ZSH Variables
# History
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# Don't check the mail
MAILCHECK=0
# Directory stack
DIRSTACKSIZE=10
#==============================================================================
# Completion
autoload -Uz compinit bashcompinit
compinit
bashcompinit
#source ${HOME}/projects/crucible/misc/crucible-completion.bash
source ${HOME}/.local/bin/mesa-run-comp.sh
# match uppercase from lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# Don't match .svn files/directories
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/).svn'
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#.svn'
#==============================================================================
# Print the current user, host, and path in the title bar of the terminal
# emulator window
chpwd() {
[[ -t 1 ]] || return
case $TERM in
sun-cmd) print -Pn "\e]1;%n@%m: %~\e\\"
;;
*xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;%n@%m: %~\a"
;;
esac
}
chpwd
#==============================================================================
# Set color usage
autoload -U colors
autoload -U zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
# Hash the host name into a color to use for the command prompt
host_color=$(hostname | sum | awk -v ncolors=${terminfo[colors]} '{print 1 + ($1 % (ncolors - 1))}')
# Set the prompt with color
PS1="%B%F{${host_color}}%n@%m%F{bg-white}%b%# "
RPS1="%B%F{blue}%~%(0?.. %F{red}(%?%))%b"
PS2="%B%F{${host_color}}%1_%b%F{bg-white}> "
# Use color in ls
eval "`dircolors -b`"
alias ls='ls --color=auto'
# Use color in completions
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# Use color in grep
export GREP_COLOR='m=01;35'
alias grep="grep --color"
else
# Set the prompt without color
PS1="%n@%m%# "
RPS1="%~%(0?.. (%?%))"
PS2="%1_> "
fi
#==============================================================================
# Aliases
#alias vim="vimx"
#==============================================================================
# Environment variables
#export PAGER='less'
export EDITOR='vim'
export VISUAL='vim'
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
#==============================================================================
# Stuff for Android Development
android-env() {
export PATH="$PATH:$HOME/.local/android-sdk-linux/tools:$HOME/.local/android-sdk-linux/platform-tools:$HOME/.local/android-ndk-r8b"
}
#==============================================================================
# Stuff for Wayland Development
wayland-env() {
export WLD=$HOME/.local/wayland
export LD_LIBRARY_PATH=$WLD/lib
export PKG_CONFIG_PATH=$WLD/lib/pkgconfig:$WLD/share/pkgconfig
export ACLOCAL="aclocal -I $WLD/share/aclocal"
export PATH=$WLD/bin:$PATH
}
export USE_CCACHE=1
export CCACHE_DIR="${HOME}/.ccache"