move alias definitions to a seperate file to decrease clutter

This commit is contained in:
2025-11-18 17:13:12 +01:00
parent 7e1c0dc937
commit 18549ab4b9
2 changed files with 44 additions and 37 deletions

42
.bash_aliases Normal file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
#
# ~/.bash_aliases
# this file is sourced in ~/.bashrc and defines aliases used by the shell.
#
# replace some default tools with different ones
alias grep='rg'
alias ls='eza -Abhg --colour=auto'
# set default options
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias diff='diff --color'
alias info='info --vi-keys'
alias make='make -j'
alias ip='ip -c'
# aliases to avoid mistakes
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -I'
# aliases for quitting
alias :qa='exit'
alias :q='exit'
alias qa='exit'
alias q='exit'
alias quit='exit'
# alternate versions of writing the same thing
alias lls='ls -l'
alias ll='ls -l'
# aliases basically for things that I am too lazy to type fully
alias py3='python3'
alias batman='bat -l man'
alias icat='kitten icat'
alias ..='cd ..'
alias ....='cd ../..'
alias ......='cd ../../..'
alias ........='cd ../../../..'

39
.bashrc
View File

@@ -28,6 +28,7 @@ _make() {
-e "s/^([Mm]akefile:[0-9]+:.*)/\x1b[33m\1\x1b[0m/" \
-e "s/^.*error.*$/\x1b[31m&\x1b[0m/I" >&2)
}
alias make='_make'
# lazily loads the git utilities, to prevent slowdowns
__lazy_git_ps1() {
@@ -69,43 +70,7 @@ HISTIGNORE='exit*:clear*:\:*:echo*'
shopt -s checkwinsize # check the window size after each command (and if necessary, the values of LINES and COLUMNS)
shopt -s globstar # enable globstar (**/*)
#
# aliases
#
# aliases for colour
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias ls='eza -Abhg --colour=auto'
alias grep='rg'
alias diff='diff --color'
alias ip='ip -c'
# application aliases
alias ncdu='ncdu --color=dark -t 16'
alias bat='bat --wrap never --tabs 4 --theme gruvbox-dark'
alias make='_make -j'
# aliases to avoid mistakes
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -I'
alias :qa='exit'
alias qa='exit'
alias :q='exit'
alias q='exit'
alias py3='python3'
alias info='info --vi-keys'
alias batman='bat -l man'
# quality of life short-hands
alias ..='cd ..'
alias ....='cd ../..'
alias ......='cd ../../..'
alias ........='cd ../../../..'
alias lls="ls -l"
alias ll="ls -l"
[ -f "$HOME/.bash_aliases" ] && . .bash_aliases
# cute lil hyfetch :3
[[ $TERM == "xterm-kitty" ]] && fastfetch