-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
188 lines (140 loc) · 5.03 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
##umask 022
# Lines configured by zsh-newuser-install
HISTFILE=~/.zhistfile
HISTSIZE=10000
SAVEHIST=10000
# WSL Display export
#export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):0
#export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0
#export LIBGL_ALWAYS_INDIRECT=1
#nvm
#export NVM_DIR="$HOME/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#if [[ -f /mnt/c/Users/chq-stephenco/proxy_configs ]]; then
# . /mnt/c/Users/chq-stephenco/proxy_configs
#fi
#fpath+=("$HOME/.zsh/pure")
#WSL Browser
#export BROWSER="/mnt/c/Program\ Files/Mozilla\ Firefox/firefox.exe"
#export PATH=/mnt/c/Users/chq-stephenco/bin:/home/chq-stephenco/.local/bin:$PATH
#export JAVA_HOME=/usr/lib/jvm/java-6-sun
#export CATALINA_HOME=/usr/share/tomcat6
#export CLASSPATH=/usr/share/maven-repo/
export EDITOR=vim
#source ~/qmk_utils/activate_wsl.sh
setopt correct appendhistory autocd extendedglob nomatch notify inc_append_history
unsetopt beep
bindkey -v
bindkey "\e[7~" beginning-of-line
bindkey "\e[8~" end-of-line
bindkey "^R" history-incremental-search-backward
#bindkey "\eOH" beginning-of-line
#bindkey "\eOF" end-of-line
#bindkey "\e[5~" beginning-of-buffer-or-history
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/stephen/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
#-----------SPECTRUM_LS------------------
#! /bin/zsh
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <[email protected]>
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG
FX=(
reset "%{[00m%}"
bold "%{[01m%}" no-bold "%{[22m%}"
italic "%{[03m%}" no-italic "%{[23m%}"
underline "%{[04m%}" no-underline "%{[24m%}"
blink "%{[05m%}" no-blink "%{[25m%}"
reverse "%{[07m%}" no-reverse "%{[27m%}"
)
for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-This used to be in some other language I dont understand}
# Show all 256 colors with color number
function spectrum_ls() {
for code in {000..255}; do
print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Show all 256 colors where the background is set to specific color
function spectrum_bls() {
for code in {000..255}; do
print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
#-------SPECTRUM_LS---------------
d=.dircolors
test -r $d && eval "$(dircolors $d)"
## vcs_info configuration
#autoload -Uz vcs_info
##zstyle ':vcs_info:*' formats '(%b)%{%f%}'
#zstyle ':vcs_info:*' check-for-changes true
#zstyle ':vcs_info:*' stagedstr '%{%F{yellow}%B%}%{%f%}'
#zstyle ':vcs_info:*' unstagedstr '%{%F{red}%B%}%{%f%}'
#zstyle ':vcs_info:*' formats "%{%F{012}%}%{%F{012}%} %b %c%u%{%f%} %{%F{012}%} %{%F{007}%}"
if [[ "$TERM" == "xterm" ]]; then
export TERM=xterm-256color
fi
function precmd() {
if [[ -w $PWD ]]; then
#PR_PWDCOLOR=$'%{\e[32m%}'
PR_PWDCOLOR="%{%F{002}%}"
else
PR_PWDCOLOR="%{%F{001}%}"
fi
#vcs_info
}
autoload -U promptinit; promptinit
#prompt pure
setprompt() {
setopt prompt_subst
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 256 ]]; then
autoload -U colors && colors
# for color in red green yellow white black blue cyan gray; do
# eval pr_$color='%{$fg[${(l)color}]%}'
# eval pr_bright_$color='%{$fg_bold[${(l)color}]%}'
# done
pr_reset="%{$reset_color%}"
#pr_pwd_default=$'%{\e[38;5;78m%}'
pr_pwd_yellow=$'%{\e[38;5;226m%}'
pr_pwd_default="%{%f{022}%}"
# prompt=$'${pr_red} \u2584
#${pr_bright_blue}\u2587${pr_red}\u2518${pr_bright_white}%n${pr_blue}@${pr_bright_blue}%m ${pr_reset}${pr_blue}(${pr_pwdcolor}%~${pr_blue})
#${pr_bright_blue}\u2514${pr_green}\u2586${pr_reset} '
prompt=$'
#%{%F{014}%}%n%{%F{012}%} ⇨ %{%F{004}%}%m%{%F{012}%} ⇨ ${PR_PWDCOLOR}%~ ${vcs_info_msg_0_}
#%{%b%}${pr_reset}%{%F{014}%}➤%{%F{004}%}➤%{%F{008}%}➤%{%f%} '
# prompt=$'
#%{%F{014}%}%n%{%F{012}%} ⇨ ${PR_PWDCOLOR}%~ ${vcs_info_msg_0_}
#%{%b%}${pr_reset}%{%F{014}%}➤%{%F{004}%}➤%{%F{008}%}➤%{%f%} '
# prompt=$'
#${pr_reset}${pr_blue}(${pr_pwdcolor}%~${pr_blue}) ${vcs_info_msg_0_}> ${pr_reset}'
else
prompt=$'
#%{%F{014}%}%n%{%F{012}%} ⇨ %{%F{004}%}%m%{%F{012}%} ⇨ ${PR_PWDCOLOR}%~ ${vcs_info_msg_0_}
#%{%b%}${pr_reset}%{%F{014}%}➤%{%F{004}%}➤%{%F{008}%}➤%{%f%} '
# prompt=$'%n@%m (%~)\n>>> '
fi
}
setprompt
#if [ $(tty) = '/dev/tty1' ]; then
# startx 2> /dev/null
# logout
#fi
#PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
############## Aliases
alias ls="ls --color -h --group-directories-first"
alias lsa="ls -Al"
alias lsl="ls -l"
alias du1="du -h --max-depth=1"
alias vi="vim"
#[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh