Last active
November 21, 2023 08:57
-
-
Save robby-robby/b390eeb9ba34640ca1b29ce4299718b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# Alias a 'cd' to all your ~/project directories on the command line with @<projectname> | |
# just type: @my_cool_project -- to 'cd' to '~/projects/my_cool_project' | |
# to install just add `source alias_projects.zsh` to your ~/.zshrc | |
PROJECTS_DIR=$HOME/projects | |
for dir in $( | |
ls -lta $PROJECTS_DIR | | |
grep ^d | | |
head -n 25 | | |
awk '{print $9}' | | |
grep '[^\ ]\{3,\}' | |
); do | |
alias @$dir="cd $PROJECTS_DIR/$dir" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment