Skip to content

Instantly share code, notes, and snippets.

@williameliel
Created June 8, 2016 14:40
Show Gist options
  • Save williameliel/d00958f4ed7a0b6e806fb03026adad12 to your computer and use it in GitHub Desktop.
Save williameliel/d00958f4ed7a0b6e806fb03026adad12 to your computer and use it in GitHub Desktop.
Add Visual Studio Code to Command line with a Folder as params...
#in ~/bin create a file called vscode and give it execute permissions and copy the following:
#!/bin/bash
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
open -a "Visual Studio Code" --args "$F"
fi
#That's it! if you havent done it, also add this to ~/.bash_profile
#export PATH=~/bin:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment