-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
144 lines (109 loc) · 3.73 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
###########################
#########ZSH CONFIG########
###########################
# Compfix
ZSH_DISABLE_COMPFIX=true
# Path to your oh-my-zsh installation.
export ZSH=/Users/$USER/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="spaceship"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
extract
)
source $ZSH/oh-my-zsh.sh
source $ZSH/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# emulate bash PROMPT_COMMAND (only for zsh)
precmd() { eval "$PROMPT_COMMAND" }
###########################
###Add variables to path###
###########################
# Add composer stuff to path
export PATH=$PATH:$HOME/.composer/vendor/bin
# Add python to path
if [ -d "$HOME/Library/Python/3.8/bin/" ] ; then
PATH="$HOME/Library/Python/3.8/bin/:$PATH"
PATH="$HOME/Library/Python/3.8/lib/:$PATH"
fi
# Add php to path
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
# Added by n-install (see http://git.io/n-install-repo).
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"
# Add android emulator to path
export PATH="/Users/$USER/Library/Android/sdk/emulator:$PATH"
export ANDROID_HOME="/Users/$USER/Library/Android/sdk"
export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
export PATH="$PATH:/Users/$USER/flutter/bin"
export PATH="/usr/local/sbin:$PATH"
export GOPATH="/Users/$USER/.go"
export PATH="$PATH:${GOPATH}/bin"
############################
#Custom added functionality#
############################
# Change default language
export LANG=en_EN.UTF-8
export LC_ALL=en_US.UTF-8
# Import aliases from separate file
if [ -f ~/.zsh_aliases ]; then
. ~/.zsh_aliases
fi
# open new terminal in same dir
PROMPT_COMMAND='pwd > "${HOME}/.cwd"'
[[ -f "${HOME}/.cwd" ]] && cd "$(< ${HOME}/.cwd)"
# script to initialize ssh-agent and add all identities to it
{
eval `ssh-agent -s`
find ~/.ssh/ -type f -exec grep -l "PRIVATE" {} \; | xargs ssh-add -K
}
# Function to create new alias
new-alias () {
if [ -z "$1" ]; then
echo "alias name:"
read NAME
else
NAME=$1
fi
if [ -z "$2" ]; then
echo "alias definition:"
read DEFINTION
else
if [ "$2" = "-cd" ]; then
DEFINTION='cd '
else
DEFINTION=$2
fi
fi
echo "alias $NAME='$DEFINTION'" >> ~/.zsh_aliases
. ~/.zsh_aliases
}
# Configure shell completion from brew packages
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
source /Users/$USER/.zsh_signature
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# Add completion for grepfind
source $GOPATH/src/github.com/tomnomnom/gf/gf-completion.zsh
# Add completion for github
eval "$(gh completion -s zsh)"
# Add pyenv to path
export PATH="/Users/filip/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"