dotfiles/bash/.bash_aliases

57 lines
1.9 KiB
Bash
Executable File

# git
alias gitp="git push"
alias gitpl="git pull"
alias gitplu="git pull upstream"
alias gitom="git push origin master"
alias gitf="git fetch"
alias gits="git status"
alias gitch="git checkout $1"
alias gitd="git diff"
alias gitb="git branch"
alias gitr="git remote"
alias gitfc="gitf && gitch"
alias gita="git add"
alias gitap="git add -p"
alias gitrp="git checkout -p"
function gitc {
if [ -z "$1" ]; then
git commit
else
git commit -m "$@"
fi
}
function gitcp {
gitc "$@" && gitp;
}
alias gitlg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset by %an' --abbrev-commit --date=relative"
function mcd {
mkdir $1 && cd $1;
}
function calc {
echo "$@" | bc
}
alias cls="clear"
alias mx="tmux a"
alias vimdiff="nvim -d"
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -p' # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias less='less -FSRXc' # Preferred 'less' implementation
lcd() { builtin cd "$@"; ll; } # Always list directory contents upon 'cd'
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias ....='cd ../../../' # Go back 3 directory levels
alias ~="cd ~" # ~: Go Home
alias c='clear' # c: Clear terminal display
alias path='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths
mcd () { mkdir -p "$1" && cd "$1"; } # mcd: Makes new Dir and jumps inside