From 6e0ced908d9f277d8d30499db2b5263ad9164b9d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 8 Nov 2026 15:59:35 +0200 Subject: chore(bash): More generic cd repo implementation --- bash/.bashrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bash') diff --git a/bash/.bashrc b/bash/.bashrc index 6350dbb..546b414 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -296,8 +296,9 @@ export PROMPT_COMMAND="shell_var_fix;" alias bd="popd" # back directory alias fd="repushd" + export CDREPO_PREFIX="$HOME/Programming" cdrepo() { - cd "$HOME/Programming/$1/$2" + cd "$CDREPO_PREFIX/$1/$2" } # Huge thanks to: https://stackoverflow.com/a/39729507 _cdrepo_comp() { @@ -310,11 +311,11 @@ export PROMPT_COMMAND="shell_var_fix;" while IFS= read line do [ -z "$line" ] && continue - line="${line##"$HOME"/Programming/"$_folder"/}/" + line="${line##"$CDREPO_PREFIX/$_folder/"}/" line="${line// /\\ }" COMPREPLY+=("$line") done <