From 2f189c3cc03d47d2c71cbc10b9e31d0564ebb779 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Fri, 6 Jun 2025 08:46:55 +0200 Subject: [PATCH] style(bash): clean up aliases and add section comments (#26) Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/26 --- .bash_aliases | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.bash_aliases b/.bash_aliases index f2d6f7b..fb22788 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -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,19 +97,14 @@ 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 local user="${1:-$(whoami)}" 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" \ No newline at end of file +} \ No newline at end of file