-
Notifications
You must be signed in to change notification settings - Fork 1
/
_zshrc
126 lines (89 loc) · 3.26 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
#!/bin/zsh
# 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="robbyrussell"
# 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 mvn gradle )
source $ZSH/oh-my-zsh.sh
precmd () {
# taken as-is from ZSH precmd definition
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
#export PS1='$(random_emoji) %{$fg_bold[green]%}%d %{$reset_color%}'
export PS1='%{$fg_bold[green]%}%d %{$reset_color%}'
export PS2='%{$fg_bold[green]%}%_> %{$reset_color%}'
export RPS1='%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%}'
}
# disable autocorrect feature
unsetopt correct_all
[[ -e ${HOME}/bin ]] && PATH="${PATH}:${HOME}/bin"
[[ -e ${HOME}/.dotfiles/bin ]] && PATH="${PATH}:${HOME}/.dotfiles/bin"
# get local config, if any
if [[ -f ${HOME}/.localzshrc ]]; then
source ${HOME}/.localzshrc
fi
export PATH="\
${MVN_HOME}/bin:\
${GRADLE_HOME}/bin:\
${JAVA_HOME}/bin:\
${PATH}"
export TERM='xterm-256color'
# aliases
# use vim as default editor (called when typing Ctrl-x Ctrl-e
export EDITOR=vim
# zsh highlighting
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
source $HOME/.dotfiles/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
ZSH_HIGHLIGHT_STYLES[path]=none
ZSH_HIGHLIGHT_STYLES[cursor]='fg=blue'
export XMODIFIERS=@im=ibus
# remove annoying jayatanaag message
unset JAVA_TOOL_OPTIONS
SSH_ENV="$HOME/.ssh/environment"
# remove conflicting oh-my-zsh aliases with my aliases
unalias gpr
unalias gprv
unalias gbm
unalias gap
source ~/.dotfiles/_alias
which fd > /dev/null
if [[ 0 -eq $? ]]; then
export FZF_DEFAULT_COMMAND="fd ."
export FZF_CTRL_T_COMMAND="fd --color=always ."
export FZF_ALT_C_COMMAND="fd --color=always --type d ."
fi
FZF_FOLDER=/usr/share/doc/fzf
if [ -e "${FZF_FOLDER}" ]; then
# multi-line + ansi colors
export FZF_DEFAULT_OPTS="--multi --ansi --reverse --height 40% --border"
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=dark
--color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f
--color=info:#af87ff,prompt:#5fff87,pointer:#ab5cff,marker:#ff0000,spinner:#ff87d7
'
source ${FZF_FOLDER}/examples/completion.zsh
source ${FZF_FOLDER}/examples/key-bindings.zsh
fi
# zsh history without duplicates
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS
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