This commit is contained in:
2021-06-27 19:28:33 +02:00
parent 800dc876e8
commit f19d3fdaec
11 changed files with 137 additions and 86 deletions

59
.zshrc
View File

@ -28,8 +28,8 @@ export PATH="/home/paramah/.gem/ruby/2.3.0/bin:$PATH"
export PATH="/home/paramah/.gem/ruby/2.5.0/bin:$PATH"
export PATH="/home/paramah/.gem/ruby/2.7.0/bin:$PATH"
export PATH="/home/paramah/.local/bin:$PATH"
export PATH=$PATH:$HOME/.SpaceVim/bin
export PATH=$PATH:$HOME/.captain/bin
export PATH="/home/paramah/.cache/rebar3/bin":$PATH
export PATH=/home/paramah/.captain/bin:$PATH
#Home bin (last always!)
export PATH="/home/paramah/go/bin:$PATH"
@ -63,8 +63,10 @@ plugins=(
aws
ssh-agent
#git-flow-completion
docker
golang
terraform
aterminal
)
@ -233,6 +235,7 @@ source <(hcloud completion zsh)
#
eval "$(_JZ_COMPLETE=source_zsh jz)"
eval "$(_HAJDUK_COMPLETE=source_zsh hajduk)"
eval "$(_H_COMPLETE=source_zsh h)"
eval "$(direnv hook zsh)"
eval "$(register-python-argcomplete gitlab)"
@ -258,6 +261,18 @@ tfc(){
terraform console -var-file=vars/$(terraform workspace show).tfvars $1
}
gitc(){
git commit -a -S $1
}
ec2-list(){
aws ec2 describe-instances \
--filter "Name=instance-state-name,Values=running" \
--query "Reservations[*].Instances[*].[PublicIpAddress, Tags[?Key=='Name'].Value|[0], LaunchTime, InstanceId]" \
--output table
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
@ -270,3 +285,43 @@ complete -C aws_completer aws
eval "$(_MOLECULE_COMPLETE=source molecule)"
#. ~/.cache/wal/colors.sh
#
#
function prompt_docker_host() {
if [[ ! -z "${DOCKER_HOST}" ]]; then
proto="$(echo $DOCKER_HOST | grep :// | sed -e's,^\(.*://\).*,\1,g')"
url=$(echo $DOCKER_HOST | sed -e s,$proto,,g)
user="$(echo $url | grep @ | cut -d@ -f1)"
hostport=$(echo $url | sed -e s,$user@,,g | cut -d/ -f1)
host="$(echo $hostport | sed -e 's,:.*,,g')"
p10k segment -b blue -f black -t "${host}"
fi
}
function prompt_jzmode() {
if [ -f .jz-mode ]; then
p10k segment -b '#012845' -f white -t $(cat .jz-mode)
fi
}
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=docker_host
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=jzmode
decodeuuid() {
http https://www.uuidtools.com/api/decode/$1 |jq
}
rpg () {
rpg-cli "$@"
cd "$(rpg-cli pwd)"
}
mh() {
xrandr --output DP1-1 --auto --right-of eDP1
xrandr --output DP1-2 --auto --left-of eDP1
theme
}
export PAGER=bat
#cat ~/.ideas