-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.zshrc
More file actions
158 lines (119 loc) · 3.66 KB
/
.zshrc
File metadata and controls
158 lines (119 loc) · 3.66 KB
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
autoload -U colors && colors
PS1="%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[cyan]%}%m:%{$fg[yellow]%}%~ %{$reset_color%}%% "
function dcid {
echo $(pwd | grep -oh "[^/]*$")
}
function gpuoff {
echo "auto" | sudo tee /sys/bus/pci/devices/0000:01:00.0/power/control
}
function push {
git push origin $(git branch | grep "\*" | sed "s/\* //g")
}
function pull {
git pull origin $(git branch | grep "\*" | sed "s/\* //g")
}
function fetch {
get fetch --all
}
function dc() {
if command -v docker-compose >/dev/null 2>&1; then
docker-compose $@
else
docker compose $@
fi
}
function dx {
remaining="${@:2}"
dc exec $1 sh -c "${remaining:-bash -c \"stty cols $COLUMNS rows $LINES && bash\"}"
}
function dcp {
id=$(dcid)
docker cp $1 ${id}_${2}_1:/tmp/
dx $2
}
function fullpath {
echo "$(hostname):$(readlink -f $1)"
}
function clone {
if git clone git@bitbucket.org:countable-web/$1.git; then
echo "found it on github."
else
git clone https://countable@bitbucket.org/countable-web/$1.git
fi
}
# Customize to your needs...
export PATH=$HOME/dotfiles/bin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:.:$HOME/.local/bin
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# for mac
#export PATH=/Developer/usr/libexec/git-core/:$PATH
source $HOME/dotfiles/.aliases
# start zgen
if [ -f ~/.zgen-setup ]; then
source ~/.zgen-setup
fi
# end zgen
# set some history options
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_all_dups
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_reduce_blanks
setopt hist_save_no_dups
setopt hist_verify
# Share your history across all your terminal windows
setopt share_history
setopt noclobber
# set some more options
setopt pushd_ignore_dups
setopt pushd_silent
# Keep a ton of history.
HISTSIZE=100000
SAVEHIST=100000
HISTFILE=~/.zsh_history
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
# Long running processes should return time after they complete. Specified
# in seconds.
REPORTTIME=2
TIMEFMT="%U user %S system %P cpu %*Es total"
# alias expansion http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html
globalias() {
if [[ $LBUFFER =~ ' [A-Z0-9]+$' ]]; then
zle _expand_alias
zle expand-word
fi
zle self-insert
}
zle -N globalias
bindkey " " globalias
bindkey "^ " magic-space # control-space to bypass completion
bindkey -M isearch " " magic-space # normal space during searches
# shift + left/right arrow key to move cursor by a word
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
# for mac
#export GIT_EXEC_PATH=/opt/local/libexec/git-core
# zgen zsh plugins
source "${HOME}/.zgen/zgen.zsh"
#zgen load zsh-users/zsh-syntax-highlighting
zgen load zsh-users/zsh-history-substring-search
# Set keystrokes for substring searching
#zmodload zsh/terminfo
#bindkey "$terminfo[kcuu1]" history-substring-search-up
#bindkey "$terminfo[kcud1]" history-substring-search-down
#zgen load djui/alias-tips
zgen load zsh-users/zsh-autosuggestions
#zgen load chrissicool/zsh-256color
export LSCOLORS='Exfxcxdxbxegedabagacad'
export LS_COLORS='di=1;34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
#zgen load skx/sysadmin-util
#if [ -f $HOME/.nvm/nvm.sh ]; then
# source $HOME/.nvm/nvm.sh
# nvm use stable
#fi
# This is disabled for now as it causes permission errors.
#source $HOME/dotfiles/bin/z.sh
export AWS_DEFAULT_PROFILE=default