alias
This commit is contained in:
parent
31612146ff
commit
3d515c4832
77
home/.aliasrc
Normal file
77
home/.aliasrc
Normal file
@ -0,0 +1,77 @@
|
||||
declare -A alias_list=(
|
||||
|
||||
# ZSH
|
||||
[ll]='ls -alF'
|
||||
[ls]='ls -lah --color'
|
||||
[grep]='grep --color=auto'
|
||||
[vi]='nvim'
|
||||
[lpg]='cd ~/git/lucidpoint'
|
||||
[ppg]='cd ~/git/personal'
|
||||
[downloads]='cd ~/Downloads'
|
||||
[desktop]='cd ~/Desktop'
|
||||
[docs]='cd ~/Documents'
|
||||
[pip]='pip3'
|
||||
[python]='python3'
|
||||
|
||||
# PYTHON
|
||||
[ve]='source venv/bin/activate'
|
||||
|
||||
# GIT
|
||||
[gaa]='git add --all'
|
||||
[gcm]='git commit --all --message'
|
||||
[glo]='git log --oneline --decorate --graph --all'
|
||||
[gl]='git pull'
|
||||
[gp]='git push'
|
||||
[gpd]='git push --dry-run'
|
||||
[gpv]='git push --verbose'
|
||||
[grb]='git rebase'
|
||||
[grv]='git remote --verbose'
|
||||
[gs]='git show --pretty=short'
|
||||
[gst]='git status --short'
|
||||
[gd]='git diff'
|
||||
[gdca]='git diff --cached'
|
||||
[gdcw]='git diff --cached --word-diff'
|
||||
[gds]='git diff --staged'
|
||||
[gdw]='git diff --word-diff'
|
||||
|
||||
# SSH
|
||||
[ed]='ssh errol@edesktop.sancaktar.net'
|
||||
[fs]='ssh errol@fs1.sancaktar.net'
|
||||
|
||||
# Kubernetes
|
||||
[k]='kubectl'
|
||||
# Terraform/Tofu
|
||||
[t]='tofu'
|
||||
)
|
||||
|
||||
|
||||
# Alias Functions
|
||||
|
||||
gc() {
|
||||
git add --all
|
||||
if [ -n "$1" ]
|
||||
then
|
||||
git commit --all --message "$1"
|
||||
else
|
||||
git commit -m update
|
||||
fi
|
||||
git push --verbose
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# Alias Loop
|
||||
current_shell=`cat /proc/$$/comm`
|
||||
#Bash
|
||||
if [[ "$current_shell" == 'bash' ]]; then
|
||||
for alias_def in "${!alias_list[@]}"; do
|
||||
alias $alias_def="${alias_list[$alias_def]}"
|
||||
done
|
||||
fi
|
||||
if [[ "$current_shell" == 'zsh' ]]; then
|
||||
#Zsh
|
||||
for alias_def in "${(k@)alias_list[@]}"; do
|
||||
alias $alias_def="${alias_list[$alias_def]}"
|
||||
done
|
||||
fi
|
Loading…
Reference in New Issue
Block a user