#!/usr/bin/env bash alias gah='sudo $(fc -ln -1)' alias nvime="nvim ~/.config/nvim/init.vim" alias socks="ssh -D 8008 emerald -fN" alias o="xdg-open" alias gc="git commit -v -s" alias gst="git status --short" alias ga="git add" alias gd="git diff --minimal" alias gl="git log --oneline --decorate --graph" alias ls="ls --color" alias vim="nvim" function up { ~/bin/icyup.sh "$1" } function nvmon { source ~/.nvm/nvm.sh } function envac { source .env/bin/activate } function vpn { ~/bin/vpnon.sh } function f() { fff "$@" cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d")" } function git_branch() { local git_status="$(git status 2> /dev/null)" local on_branch="On branch ([^${IFS}]*)" local on_commit="HEAD detached at ([^${IFS}]*)" if [[ $git_status =~ $on_branch ]]; then local branch=${BASH_REMATCH[1]} echo -ne "───${grn} $branch ${rst}" elif [[ $git_status =~ $on_commit ]]; then local commit=${BASH_REMATCH[1]} echo -ne "───${ylw} $commit ${rst}" fi }