-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc.pre-oh-my-zsh
175 lines (144 loc) · 3.82 KB
/
.zshrc.pre-oh-my-zsh
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
# Profiler startup
PROFILE_STARTUP=false
if [[ "$PROFILE_STARTUP" == true ]]; then
PS4=$'%D{%M%S%.} %N:%i> '
exec 3>&2 2>$HOME/tmp/startlog.$$
setopt xtrace prompt_subst
fi
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/faure/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstal
# Environment variables
export EDITOR=nvim
export VISUAL=nvim
export BROWSER=firefox
# Enable autojump
# source /etc/profile.d/autojump.zsh
# fasd
eval "$(fasd --init auto)"
# Aliases
alias hibernate="i3lock && systemctl hibernate"
alias suspend="i3lock && systemctl suspend"
alias vim="nvim"
alias cat="bat"
alias tn="tmux new-session"
alias ta="tmux attach"
alias i3u="vim ~/.config/i3/config"
alias zshu="vim ~/.zshrc.pre-oh-my-zsh"
alias vimu="vim ~/.config/nvim/init.vim"
alias polyu="vim ~/.config/polybar/config"
alias wiki="vim -c \"VimwikiIndex\""
alias preview="fzf --preview 'bat --color \"always\" {}'"
alias tigs="tig status"
alias v='f -e nvim'
# Editing path for sudoless npm install -g
#export PATH=$HOME/.node_modules/bin:$PATH
export PATH=$HOME/.yarn/bin:$PATH
export PATH=$HOME/bin:$PATH
#export npm_config_prefix=~/.node_modules
# Golang env vars
export GOPATH=~/Development/gocode
export PATH=$PATH:$GOPATH/bin
# Adding the android SDK to PATH for React Native debugging
#export PATH=/home/faure/Builds/genymotion/pkg/genymotion/opt/genymotion/tools:$PATH
#export PATH=/home/faure/Builds/genymotion/pkg/genymotion/opt/genymotion:$PATH
# Adding this for awscli
#export PATH=~/.local/bin:$PATH
# Pet setup
function prev() {
PREV=$(fc -lrn | head -n 1)
sh -c "pet new `printf %q "$PREV"`"
}
# Help
function help() {
PREV=$(fc -lrn | head -n 1 | cut -d " " -f1)
sh -c "man $PREV"
}
# Search history with up down keys
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
bindkey "^[OA" up-line-or-beginning-search
bindkey "^[OB" down-line-or-beginning-search
# Search history with ctrl R
bindkey "^R" history-incremental-search-backward
# NVM configs
export NVM_DIR="$HOME/.nvm"
export NVM_NOT_LOADED=true
lazy_load_nvm() {
if $NVM_NOT_LOADED; then
export NVM_NOT_LOADED=false
unset -f node
unset -f yarn
unset -f npm
eval ". \"$NVM_DIR/nvm.sh\""
fi
}
nvm() {
lazy_load_nvm
nvm "$@"
}
node() {
lazy_load_nvm
node "$@"
}
yarn() {
lazy_load_nvm
yarn "$@"
}
npm() {
lazy_load_nvm
npm "$@"
}
#NVIM settings
export MYVIMRC=/home/faure/.config/nvim/init.vim
export SPROMPT=$PROMPT
# VI MODE visual indicator
function zle-line-init zle-keymap-select {
case ${KEYMAP} in
(vicmd) PROMPT="${SPROMPT}%{$fg[yellow]%}*%{$reset_color%} ";;
(main|viins) PROMPT=$SPROMPT;;
(*) PROMPT=$SPROMPT;;
esac
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
# virtualenvwrapper
export WORKON_HOME=~/.Envs
source /usr/bin/virtualenvwrapper_lazy.sh
source ~/.autoenv/activate.sh
# Profiler footer
if [[ "$PROFILE_STARTUP" == true ]]; then
unsetopt xtrace
exec 2>&3 3>&-
fi
# fzf
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
export FZF_DEFAULT_COMMAND='fd --type f'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_DEFAULT_OPTS="--layout=reverse --border --bind='ctrl-o:execute(nvim {})+abort'"
export FZF_TMUX=1
# bat
export BAT_THEME="Nord"
# mpw
source $HOME/.mpw
# ibus
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
# Ruby
export PATH=$PATH:/home/faure/.gem/ruby/2.6.0/bin
export PATH=$PATH:/root/.gem/ruby/2.6.0/bin