Skip to content

Instantly share code, notes, and snippets.

@AshConnolly
Created April 30, 2020 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshConnolly/4188ff4fe8373c390fb1afc1d51d5836 to your computer and use it in GitHub Desktop.
Save AshConnolly/4188ff4fe8373c390fb1afc1d51d5836 to your computer and use it in GitHub Desktop.
For loop to open all subdirectories of current directory in vscode
# For loop to open all subdirectories in vscode
function openfoldersincode() {
declare -a dirs
i=1
for d in */
do
dirs[i++]="${d%/}"
done
echo "There are ${#dirs[@]} dirs in the current path."
for((i=1;i<=${#dirs[@]};i++))
do
echo $i "${dirs[i]}"
code "${dirs[i]}"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment