dotfiles/.config/oh-my-zsh/aliases.zsh

51 lines
1 KiB
Bash
Raw Normal View History

2021-04-02 19:06:33 +02:00
# general aliases
## Alias handling
alias editalias='vim ~/.config/oh-my-zsh/aliases.zsh'
alias updatealias='source ~/.zshrc'
## https://www.atlassian.com/git/tutorials/dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
## ssh workaround for kitty terminal
alias ssh='sshKittyWorkaround'
function sshKittyWorkaround {
if [[ "$TERM" == "xterm-kitty" ]]; then
kitty +kitten ssh $argv;
else
"ssh" $argv;
fi
}
## navigation
alias ..='cd ..'
alias ...='cd ../..'
## 'ls' to 'exa'
alias ls='exa -l --color=always --group-directories-first'
alias la='exa -al --color=always --group-directories-first'
alias ll='exa -l --color=always --group-directories-first'
## 'grep' to 'rg' -> 'ripgrep'
alias grep='rg'
## 'cat' to 'bat'
alias cat='bat'
## TODO 'delta' instead of 'git diff'
## confirm before overwriting files
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -i'
## adding flags
alias df='df -h'
alias free='free -m'
## color and condense ip output
alias ipa='ip -br -c addr show'
alias ipl='ip -br -c link show'