style(bash): clean up aliases and add section comments (#26)

Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/26
This commit is contained in:
Victor Westerlund 2025-06-06 08:46:55 +02:00
parent d7c6d4c783
commit 2f189c3cc0

View file

@ -1,7 +1,11 @@
# Make dir and cd into it
mkcdir () {
mkdir -p -- "$1" && cd -P -- "$1"
}
# Change PHP CLI binary
alias phpa="sudo update-alternatives --config php"
# Kill all code-server processes. Sometimes it hangs on startup
alias kvscode="ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9"
# +-------------------+
# | Directory & Files |
# +-------------------+
# Preview contents of a file or list the contents of a directory
l () {
@ -45,6 +49,15 @@ cdll () {
cp -P -- "$1" && ll
}
# Make a new directory and cd into it
mkcdir () {
mkdir -p -- "$1" && cd -P -- "$1"
}
# +-----+
# | Git |
# +-----+
# Short-hands for various git functions
gitf () {
case "$1" in
@ -84,6 +97,10 @@ gitf () {
esac
}
# +-----+
# | SSH |
# +-----+
# SSH to machine in debug mode at local.vlw.se
sshl () {
# Set login name from first argument or default to current user
@ -91,12 +108,3 @@ sshl () {
ssh -p 2222 "$user"@local.vlw.se
}
# Generate random 16byte HEX
alias rng16="head -c 16 /dev/random | xxd -p"
# Kill VSCode processes
alias killvscode="ps uxa | grep .vscode-server | awk '{print $2}' | xargs kill -9"
# Change PHP CLI binary
alias chphp="sudo update-alternatives --config php"