-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
117 lines (95 loc) · 3.58 KB
/
dot_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
export PATH=/usr/local/bin:$HOME/bin:$PATH
export ZSH=$HOME/.oh-my-zsh
# https://github.com/sbugzu/gruvbox-zsh
ZSH_THEME="gruvbox"
SOLARIZED_THEME="dark"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
REMOTE_SESSION=true
fi
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
plugins=(
vi-mode
git
github
virtualenv
pip
python
brew
macos
history-substring-search
sublime
zsh-autosuggestions
extract
)
source $ZSH/oh-my-zsh.sh
setopt correct
# Disable wildcard matching - https://unix.stackexchange.com/a/130967
setopt nonomatch
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
setopt prompt_subst # enable command substitution (and other expansions) in PROMPT
if [ -n "$REMOTE_SESSION" ]; then
local hostname="%{$fg_bold[black]%}%m"
PROMPT=' $(virtualenv_prompt_info) %B%F{green}[%D{%m/%d} $(TZ='America/Los_Angeles' date +%H:%M)]%f%b ${hostname} ${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%(5~|%-1~/…/%3~|%4~) %{$reset_color%}'
else
PROMPT=' %B%F{green}[%D{%m/%d} $(TZ='America/Los_Angeles' date +%H:%M)] %10<..<%~%<<%f%b ${ret_status}%{$fg_bold[cyan]%}%p%B%F$(virtualenv_info)%f%b%{$reset_color%}'
fi
# fix history search (vi mode breaks this)
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey '^[[Z' reverse-menu-complete
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
bindkey -M viins 'jj' vi-cmd-mode
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
if command -v brew &> /dev/null && [[ ! -f ~/.fzf.zsh ]]; then
$(brew --prefix)/opt/fzf/install
fi
source <(fzf --zsh)
if [ -f ~/.google.zsh ]; then
source ~/.google.zsh
fi
if command -v lsd 2>&1 >/dev/null
then
alias ls='lsd'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
fi
alias tmux=tmx2
alias k=kubectl
alias cat=bat
alias grep="rg -S"
alias find=fd
alias t="todo.sh -t -c"
alias find=fd
alias glg='git log --graph --all -n 20 --pretty=format:"%Cblue%h%Creset [%Cgreen%ar%Creset] [%Cred%an%Creset] %s%C(yellow)%d%Creset"'
alias rpi='tmx2 -CC new -A -s rpi'
alias notes='tmux new -A -s notes'
# works on MacOS -- TODO: make sure these are only run on macos
alias list_dns="scutil --dns | grep 'nameserver\[[0-9]*\]'"
alias flush_dns="sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder && echo DNS flushed."
export HISTCONTROL=ignoreboth
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
export EDITOR=vim
# Contains the methods that are scheduled through crontab
source ~/.functions.sh
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/ayberk/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/ayberk/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/ayberk/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/ayberk/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
export GOPATH=$HOME/go
export BAT_THEME="Monokai Extended Bright"
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin/":$PATH
export JAVA_HOME=$HOME/OpenJDK/jdk-17.0.9.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export PATH="/Users/ayberk/Library/Application Support/Coursier/bin":$PATH
export PATH="/opt/homebrew/bin":$PATH
# stupid python
alias python=python3
alias pip=pip3
alias venv_create="python3 -m venv .venv"
alias venv_activate="source .venv/bin/activate"