This repository was archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
73 lines (62 loc) · 1.93 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
export PATH=~/.local/bin:$PATH
export EDITOR=emacs
if [[ $(uname --kernel-release) =~ [Mm]icrosoft ]];
then
pushd > /dev/null # Change directory to non-WSL location, so that
cd /mnt/c # cmd.exe doesn't print a warning about it.
if [[ -z $(cmd.exe /c tasklist | grep vcxsrv.exe) ]];
then
/mnt/c/Program\ Files/VcXsrv/vcxsrv.exe -ac -keyhook -multiwindow -wgl&!
fi
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0.0
export LIBGL_ALWAYS_REDIRECT=1
popd > /dev/null
elif [[ $(uname) == "Darwin" ]]; then
alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs"
export EDITOR="/Applications/Emacs.app/Contents/MacOS/Emacs"
else
alias docker="sudo docker"
fi
if [[ $TERM == "dumb" ]]
then
unsetopt zle
unsetopt prompt_cr
unsetopt prompt_subst
unfunction precmd
unfunction preexec
export PS1='$ '
fi
VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh
if [[ -e ${VIRTUALENVWRAPPER_SCRIPT} ]]; then
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source ${VIRTUALENVWRAPPER_SCRIPT}
fi
export HISTFILE=~/.zsh_history
export HISTSIZE=10000
export SAVEHIST=10000
setopt PROMPT_SUBST
autoload -U select-word-style
select-word-style bash
autoload -Uz vcs_info
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr ' unstaged'
zstyle ':vcs_info:*' check-for-staged-changes true
zstyle ':vcs_info:*' stagedstr ' staged'
zstyle ':vcs_info:*' actionformats \
'%{%F{green}%}%b %{%f%F{red}%}%a%{%f%}'
zstyle ':vcs_info:*' formats \
'%{$fg[green]%}%b%c%u%{$reset_color%}'
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
autoload -Uz colors
colors
function precmd() {
vcs_info
print -rP "
%{%F{blue}%}%n%{%f%F{white}%}@%{%f%F{yellow}%}%m%{%f%F{white}%}:%{%f%F{cyan}%}${PWD/$HOME/~} ${vcs_info_msg_0_}"
}
PROMPT='> '
function setTitle()
{
echo "\033];$*\07"
}