-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshrc
149 lines (118 loc) · 4.43 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
. ~/bin/setup_path
# Tramp - https://blog.karssen.org/2016/03/02/fixing-emacs-tramp-mode-when-using-zsh/
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
# For XMonad + Java apps
export _JAVA_AWT_WM_NONREPARENTING=1
export EDITOR=emacsclient
export LC_ALL=en_US.UTF-8
export JRUBY_OPTS="-J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify"
# Allow redirection to overwrite files.
setopt CLOBBER
# Share recent history between shells
export HISTFILE="$HOME/.zhistory"
setopt SHARE_HISTORY
HISTSIZE=50000
SAVEHIST=50000
export WORDCHARS="*?_-.[]~&;!#$%^(){}<>"
export ANSIBLE_NOCOWS=1
alias top=htop
alias l='ls -1 --color'
alias ls='ls --color'
alias acs='apt-cache search'
alias grep='grep --exclude-dir .svn --exclude-dir .git --exclude tags --exclude TAGS --color=auto'
alias ed="rlwrap ed -p'> '"
alias churby=chruby
alias gerp=grep
alias nnn='ruby -e "puts ARGV.pop.codepoints.inject(:+)%97"'
alias bx='bundle exec'
function ai {
echo "$@" >> ~/repos/dotfiles/extra_packages
sudo apt-get install -y --auto-remove "$@"
}
function en {
EMACSCLIENT=${EMACSCLIENT:-emacsclient}
if [[ "$1" =~ ':' ]]; then
${=EMACSCLIENT} -n +${1//*:/} ${1//:*/}
else
${=EMACSCLIENT} -n $1
fi
}
function termtitle() {
echo -e "\033]0;$1\007"
}
### Go to last opened directory when new terminal is opened ###
function store-current-path() {
echo -n `pwd` >! /run/shm/current-path
}
if [[ ! "$precmd_functions" == *store-current-path* ]]; then
precmd_functions+=("store-current-path")
fi
[[ -e /run/shm/current-path ]] && cd "$(cat /run/shm/current-path)"
### /last opened directory ###
### SSH Keychain ###
# Let re-use ssh-agent and/or gpg-agent between logins
if [ -x '/usr/bin/ksshaskpass' ]; then
export GIT_ASKPASS='/usr/bin/ksshaskpass'
export SSH_ASKPASS='/usr/bin/ksshaskpass'
export SSH_ASKPASS_REQUIRE=prefer
fi
if [ -x "/usr/bin/keychain" ]; then
if [ -f "$HOME/.ssh/id_rsa" ]; then
eval $(/usr/bin/keychain --quiet --quick --eval $HOME/.ssh/id_rsa)
elif [ -f "$HOME/.ssh/id_ed25519" ]; then
eval $(/usr/bin/keychain --quiet --quick --eval $HOME/.ssh/id_ed25519)
fi
fi
### /SSH Keychain ###
### Spaceship ZSH prompt ###
if [ -f "$HOME/repos/spaceship-prompt/spaceship.zsh" ]; then
source "$HOME/repos/spaceship-prompt/spaceship.zsh"
export SPACESHIP_DIR_TRUNC_REPO=false
#SPACESHIP_PROMPT_ORDER=(time user dir host git hg package node ruby docker aws kubecontext terraform exec_time perry line_sep battery jobs exit_code char)
SPACESHIP_PROMPT_ORDER=(time user dir host git hg package node ruby aws terraform exec_time line_sep battery jobs exit_code char)
fi
### /Spaceship ZSH prompt ###
### Chruby ###
if [[ -f /usr/local/share/chruby/chruby.sh ]]; then
source /usr/local/share/chruby/chruby.sh
chruby $(chruby | tail -1 | sed 's/.* //')
fi
### End Chruby ###
if [[ -f "$HOME/.asdf/asdf.sh" ]]; then
. "$HOME/.asdf/asdf.sh"
fi
export RUNELEVEN_DIR=/home/arne/Eleven/runeleven
# export CLOUDSDK_PYTHON=/usr/bin/python3.8
if [ -f /usr/share/google-cloud-sdk/completion.zsh.inc ]; then . /usr/share/google-cloud-sdk/completion.zsh.inc ; fi
if [ -d "$HOME/repos/zsh-completions" ]; then
fpath=("$HOME/repos/zsh-completions/src" $fpath)
fi
# Make pipewire act as a jack server
export LD_LIBRARY_PATH='/usr/${LIB}/pipewire-0.3/jack'"${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/home/arne/.sdkman"
[[ -s "/home/arne/.sdkman/bin/sdkman-init.sh" ]] && source "/home/arne/.sdkman/bin/sdkman-init.sh"
# pnpm
export PNPM_HOME="/home/arne/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# bun completions
[ -s "/home/arne/.bun/_bun" ] && source "/home/arne/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# export CLOUDSDK_PYTHON_SITEPACKAGES=1
# export CLOUDSDK_PYTHON=$HOME/opt/gcloud-venv/bin/python
# fnm
FNM_PATH="/home/arne/.local/share/fnm"
if [ -d "$FNM_PATH" ]; then
export PATH="/home/arne/.local/share/fnm:$PATH"
eval "`fnm env`"
fi
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/arne/opt/google-cloud-sdk/path.zsh.inc' ]; then . '/home/arne/opt/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/home/arne/opt/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/arne/opt/google-cloud-sdk/completion.zsh.inc'; fi