Skip to content

Instantly share code, notes, and snippets.

@emyller
Last active March 29, 2024 13:26
Show Gist options
  • Save emyller/1f0871f0d010577e6e850e392e3edffa to your computer and use it in GitHub Desktop.
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 = less -F -X
[diff]
noprefix = true
[commit]
gpgsign = true
[user]
name = Evandro Myller
email = [email protected]
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}') }
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 .env && export $(cat .env | grep -v '^#' | xargs) }
# Tilix fix
[[ $TILIX_ID ]] && source /etc/profile.d/vte.sh
# Add my SSH keys to the agent
ssh-add ~/.ssh/*.pem &> /dev/null
# 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
# Extra path
export PATH="$PATH":"$HOME/.pub-cache/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment