bash/aliases (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
#!/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
}
|