Skip to content

Instantly share code, notes, and snippets.

@partydrone
Last active July 3, 2019 02:22
Show Gist options
  • Save partydrone/302ab3bd9d1b840cf21e to your computer and use it in GitHub Desktop.
Save partydrone/302ab3bd9d1b840cf21e to your computer and use it in GitHub Desktop.
Local additions and customizations for thoughtbot/laptop script
alias back="cd ~-"
alias h="history"
alias ll="ls -aFGl"
alias up="cd .."
# Redefine commands to add options
alias cp="cp -i"
alias df="df -h"
alias du="du -h"
alias mv="mv -i"
alias rm="rm -i"
# Docker commands
alias dc="docker-compose"
alias dcb="docker-compose build"
# alias dcd="docker-compose down --remove-orphans"
alias dce="docker-compose exec"
alias dcl="docker-compose logs -f"
alias dcp="docker-compose ps"
alias dcr="docker-compose run --rm"
alias dcu="docker-compose up -d"
# docker-sync gem commands
alias ds="docker-sync"
# Kubernetes commands
alias kc="kubectl"
alias kcc="kubectl create"
alias kcd="kubectl delete"
alias kcr="kubectl run"
alias kcs="kubectl set"
alias kcg="kubectl get"
alias kct="kubectl top"
# Docker Compose functions
dcd () {
if (( $# == 0 ))
then
docker-compose down --remove-orphans
else
dc stop $@
dc rm $@
fi
}
dcdu () {
if (( $# == 0 ))
then
echo usage: dcdu service-name …
else
dc stop $@
dc rm $@
dcu $@
fi
}
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
[diff]
tool = Kaleidoscope
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" \"$REMOTE\"
[mergetool]
prompt = false
[merge]
tool = Kaleidoscope
# use custom prompt character for git repos
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
# ▸→>
echo '→'
}
# override shell prompt
export PS1='
╭  %{$fg_bold[cyan]%}%w %*%{$reset_color%} as %{$fg_bold[magenta]%}%n%{$reset_color%} on %{$fg_bold[yellow]%}%m%{$reset_color%} in %{$fg_bold[blue]%}%c%{$reset_color%}$(git_prompt_info)
╰ %(!.#.$(prompt_char)) '
# ~/.zsh/configs/post/chpwd
# Set Apple Terminal.app resume directory
if [[ $TERM_PROGRAM == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]] {
function chpwd {
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
chpwd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment