Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aisis/5ca26487ba5a9e862f8fd1b50c600d1f to your computer and use it in GitHub Desktop.

Select an option

Save aisis/5ca26487ba5a9e862f8fd1b50c600d1f to your computer and use it in GitHub Desktop.

Revisions

  1. @cdevroe cdevroe created this gist May 28, 2015.
    9 changes: 9 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    code () {
    if [[ $# = 0 ]]
    then
    open -a "Visual Studio Code" -n
    else
    [[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
    open -a "Visual Studio Code" -n --args "$F"
    fi
    }