forked from nviennot/zsh-config
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzshrc
146 lines (120 loc) · 5.23 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
export ZSH_THEME="gentoo"
# Set to this to use case-sensitive completion
# export CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
export DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls
# export DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# export DISABLE_AUTO_TITLE="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git github git-flow cap gem lol zsh-syntax-highlighting)
source /etc/profile
source $ZSH/oh-my-zsh.sh
unsetopt nomatch
unsetopt pushd_ignore_dups
# Customize to your needs...
LS_COLORS='no=00;32:fi=00:di=00;34:ln=01;36:pi=04;33:so=01;35:bd=33;04:cd=33;04:or=31;01:ex=00;32:*.rtf=00;33:*.txt=00;33:*.html=00;33:*.doc=00;33:*.pdf=00;33:*.ps=00;33:*.sit=00;31:*.hqx=00;31:*.bin=00;31:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.deb=00;31:*.dmg=00;36:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.ppm=00;35:*.tga=00;35:*.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.mpg=00;37:*.avi=00;37:*.gl=00;37:*.dl=00;37:*.mov=00;37:*.mp3=00;35:'
export LS_COLORS;
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
ZSH_HIGHLIGHT_STYLES+=(
default 'none'
unknown-token 'fg=red,bold'
reserved-word 'fg=yellow'
alias 'fg=none,bold'
builtin 'fg=none,bold'
function 'fg=none,bold'
command 'fg=none,bold'
hashed-command 'fg=none,bold'
path 'fg=cyan'
globbing 'fg=cyan'
history-expansion 'fg=blue'
single-hyphen-option 'fg=magenta'
double-hyphen-option 'fg=magenta'
back-quoted-argument 'fg=magenta,bold'
single-quoted-argument 'fg=green'
double-quoted-argument 'fg=green'
dollar-double-quoted-argument 'fg=cyan'
back-double-quoted-argument 'fg=cyan'
assign 'none'
)
#bindkey "\e[H" beginning-of-line
#bindkey "\e[F" end-of-line
bindkey "\e[1;5D" backward-word
bindkey "\e[1;5C" forward-word
alias noh="unsetopt sharehistory"
unsetopt auto_name_dirs # rvm_rvmrc_cwd fix
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
unset RUBYOPT
cd . # to rvm reload
if [[ -x `which hitch` ]]; then
hitch() {
command hitch "$@"
if [[ -s "$HOME/.hitch_export_authors" ]] ; then source "$HOME/.hitch_export_authors" ; fi
}
alias unhitch='hitch -u'
hitch
fi
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
alias nogit="disable_git_prompt_info"
compdef -d git
alias tmux="tmux -2"
PATH=~/bin/:~/node_modules/.bin/:$PATH
export PATH=$PATH:/opt/local/bin:/usr/texbin
export PATH=$PATH:~/bin:~/scripts
export PATH=$PATH:/home/christoffer/tools/ndk
export LIBVIRT_DEFAULT_URI=qemu:///system
################################################################################
# pbcopy wrapper
################################################################################
function clipboard
{
cat | nc -q1 localhost 2224
}
################################################################################
# transfer.sh wrapper
################################################################################
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }; alias transfer=transfer
################################################################################
# Linux compilation settings
################################################################################
export MENUCONFIG_COLOR=blackbg
export USE_CCACHE=1
export CCACHE_DIR=/home/christoffer/.ccache
export CCACHE_BASEDIR=/home/christoffer
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
function mountSource()
{
hdiutil attach -quiet -mountpoint ~/src ~/SourceCode.sparsebundle;
}
################################################################################
# Directory-based environment config settings
################################################################################
function source_dir() {
envdir=$1
re_env_ignore="^\."
if [ -d "$envdir" ]; then
_T=$(ls "$envdir")
if [ ! -z "$_T" ]; then
for d in $(ls -1 "$envdir"); do
if [[ "$d" =~ $re_env_ignore ]]; then
echo "ignoring env setup file '$d'" > /dev/null
else
source "$envdir/$d"
fi
done
fi
fi
}
source_dir "$ZSH/env.d"