Skip to content

Instantly share code, notes, and snippets.

@IMalaniak
Created August 4, 2022 16:06
Show Gist options
  • Save IMalaniak/82330294857ff49785d92227bbfa0e28 to your computer and use it in GitHub Desktop.
Save IMalaniak/82330294857ff49785d92227bbfa0e28 to your computer and use it in GitHub Desktop.
Alias for opening a VS Code workspace in the current folder
# add this script to your `.zshrc`
vspace() {
vsworkfolder=$(find . -maxdepth 1 -type f -name '*.code-workspace')
if [ -z "$vsworkfolder" ]; then
echo "No workspace found"
else
code "$vsworkfolder"
fi
}
# Usage:
# `cd` to the directory with VS Code workspace you want work in
# vspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment