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

53 lines
1.4 KiB
Bash
Raw Normal View History

2021-04-02 19:06:33 +02:00
# general aliases
## Alias handling
2021-04-16 12:04:30 +02:00
alias editalias='vim $HOME/.config/oh-my-zsh/aliases.zsh'
alias updatealias='exec zsh'
2021-04-02 19:06:33 +02:00
## https://www.atlassian.com/git/tutorials/dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
## navigation
alias ..='cd ..'
alias ...='cd ../..'
## 'ls' to 'exa'
alias ls='exa --long --color=always --group-directories-first --classify'
alias la='exa --all --long --color=always --group-directories-first --classify'
alias ll='exa --long --color=always --group-directories-first --classify'
alias l.='exa --all --list-dirs --long --color=always --group-directories-first --classify .*'
2021-04-02 19:06:33 +02:00
## 'grep' to 'rg' -> 'ripgrep'
alias grep='rg'
alias nocomment="rg --invert-match '''^(#|$)'''"
2021-04-02 19:06:33 +02:00
## 'cat' to 'bat'
alias cat='bat'
## TODO 'delta' instead of 'git diff'
## confirm before overwriting files
alias cp='cp --interactive'
alias mv='mv --interactive'
alias ln='ln --interactive'
alias rm='rm --interactive=always --preserve-root'
## safety nets for changing permissions on /
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
2021-04-02 19:06:33 +02:00
## adding flags
alias df='df --human-readable'
alias free='free --human'
alias du='du --human-readable --depth 2'
alias wget='wget --continue'
2021-04-02 19:06:33 +02:00
## color and condense ip output
alias ipa='ip --brief --color addr show'
alias ipl='ip --brief --color link show'
2021-04-02 19:06:33 +02:00
## always spawn new window for firefox
alias firefox='firefox --new-window'