-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
162 lines (131 loc) · 4.85 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
150
151
152
153
154
155
156
157
158
159
160
161
162
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/marc/.oh-my-zsh"
export AWS_PROFILE=sts
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="af-magic"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"
# 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 if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="%d/%m/%y %T"
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git terraform zsh-autosuggestions virtualenv asdf aws colorize git-prompt poetry)
export VIRTUAL_ENV_DISABLE_PROMPT=1
source $ZSH/oh-my-zsh.sh
# User configuration
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nano'
else
export EDITOR='nano'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# ####################################################################
alias zshconf="nano ~/.zshrc"
gitb() {
git checkout -b "mv/$1"
}
gits() {
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
}
gitd() {
branch=$(git rev-parse --abbrev-ref HEAD)
git checkout master && git branch -D ${branch} & git pull
}
gitf() {
git push --force-with-lease
}
gita() {
git commit --amend
}
# ####################################################################
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH="/home/marc/bin:$PATH"
export PATH="/home/marc/.local/bin:$PATH"
export REDSHIFT_DB=prod
. $HOME/.asdf/asdf.sh
#export PATH="$HOME/.tfenv/bin:$PATH"
#export PYENV_ROOT="$HOME/.pyenv"
#export PATH="$PYENV_ROOT/bin:$PATH"
#export PATH="$PYENV_ROOT/shims:$PATH"
#if command -v pyenv 1>/dev/null 2>&1;
# then eval "$(pyenv init -)"
#fi
#eval "$(pyenv virtualenv-init -)"
fpath+=~/.zfunc
autoload -Uz compinit && compinit
unalias gsts
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:$(yarn global bin)"
export AWS_DEFAULT_REGION=eu-west-1
function awslogin {
config_dir=$HOME/.aws
config_file=$config_dir/google_config
config_docs='https://data.pennylane.tech/posts/local-setup/'
# Checking that the config file exists, and contains the right keys
if [[ ! -f $config_file ]] ; then
echo -e "Missing $config_file, aborting. See setup instructions at \e]8;;$config_docs\a$config_docs\e]8;;\a."
return 1
fi
. $config_file
if [ -z "$google_email" ]; then
echo "Missing key 'google_email' in $config_file."
return 1
elif [ -z "$google_idp_id" ]; then
echo "Missing key 'google_idp_id' in $config_file."
return 1
elif [ -z "$google_sp_id" ]; then
echo "Missing key 'google_sp_id' in $config_file."
return 1
elif [ -z "$aws_region" ]; then
echo "Missing key 'aws_region' in $config_file."
return 1
fi
# Configuring region for all AWS commands, using the default profile
echo "[default]\nregion = ${aws_region}" > $config_dir/config
# Google SAML login, followed by Codeartifact login
gsts \
--idp-id=$google_idp_id \
--sp-id=$google_sp_id \
--aws-region $aws_region \
--cache-dir $config_dir \
--verbose \
--force \
--username $google_email \
--playwright-engine-channel "chrome"
# echo "\nLogging in to Codeartifact..."
# aws codeartifact login \
# --tool pip \
# --domain pennylane \
# --repository pypi-pennylane \
}
alias awslogin='awslogin'