Skip to content

Instantly share code, notes, and snippets.

@emyller
Last active September 19, 2025 15:25
Show Gist options
  • Select an option

  • Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.

Select an option

Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.
dot files
[alias]
st = status
br = branch
co = checkout
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev
[core]
editor = vim
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
[merge]
conflictstyle = zdiff3
[diff]
noprefix = true
[commit]
gpgsign = true
[user]
name = Evandro Myller
email = evandro.myller@flagsmith.com
signingkey = 735F9B497135A4C054F564A7C739EDD5AC9B854F
source $VIMRUNTIME/defaults.vim
set mouse-=a
syntax on
# Core plugins
# Need to install antidote: brew install antidote
# Learn more: https://getantidote.github.io
source /opt/homebrew/opt/antidote/share/antidote/antidote.zsh
source <(antidote init)
antidote bundle ohmyzsh/ohmyzsh
antidote bundle ohmyzsh/ohmyzsh path:plugins/aws
antidote bundle zdharma-continuum/fast-syntax-highlighting
# Theme
antidote bundle ohmyzsh/ohmyzsh path:themes/refined.zsh-theme
# Aliases
alias pac=yay
alias g=git
alias run=./bin/run
alias dc=docker-compose
alias kc=kubectl
alias kx=kubectx
alias t="bin/run pytest --sw --pdb"
# Functions
git-main-branch () { remote=$(git remote); echo ${remote}/$(git remote show ${remote} | awk '/HEAD branch/ {print $NF}') }
gprunesquashmerged () { main=$(git-main-branch); git checkout -q $main && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base $main $branch) && [[ $(git cherry $main $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done }
gc () { git branch --merged $(git-main-branch) | grep -v '*' | xargs git branch -d }
pr () { hub pull-request -fpm $(git branch --show-current) -b $(basename $(git-main-branch)) } # Open PR
prd () { hub pull-request -fdpm $(git branch --show-current) -b $(basename $(git-main-branch)) } # Open PR as draft
pri () { hub pull-request -fdpi $1 } # Open PR converting an issue
gf () { git fetch -p $(git remote) }
gb () { gf; git checkout --no-track $(git-main-branch) -B $1 }
yay-autoremove () { yay -Rcs $(yay -Qdtq) }
dotenv () { test -f $1 && export $(cat $1 | grep -v '^#' | xargs) }
# Tilix fix
[[ $TILIX_ID ]] && source /etc/profile.d/vte.sh
# Add my SSH keys to the agent
for file in ~/.ssh/*; do; if cat "$file" | grep -q "BEGIN OPENSSH PRIVATE KEY"; then;
ssh-add "$file" > /dev/null
fi; done
# GPG
export GPG_TTY=$(tty)
# Atuin
ATUIN_NOBIND=t antidote bundle ellie/atuin
bindkey '^[[A' history-substring-search-up
bindkey '^r' _atuin_search_widget
# AWS vault
if [[ $(command -v aws-vault) ]]; then
antidote bundle blimmer/zsh-aws-vault
eval "$(aws-vault --completion-script-zsh)"
[[ -n "$AWS_VAULT" ]] && PS1="%{$fg[yellow]%}[aws::$AWS_VAULT]%{$reset_color%} $PS1"
fi
# Virtualenvwrapper
if [[ $(command -v virtualenvwrapper.sh) ]]; then
source virtualenvwrapper.sh
fi
# Extra path
export PATH="$PATH":"$HOME/.pub-cache/bin"
# Nicer prompt
_orig_ps1="$PS1"
function update_ps1() {
if [[ $? -ne 0 ]]; then
print -P "%F{red}no papa%f\n"
export PS1="try again ${_orig_ps1}"
else
export PS1="yes papa ${_orig_ps1}"
fi
}
autoload -Uz add-zsh-hook
add-zsh-hook precmd update_ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment