Skip to content

Instantly share code, notes, and snippets.

@limafelipe
Created January 16, 2017 02:26
Show Gist options
  • Select an option

  • Save limafelipe/c8bcd7c251759a504d21fa0c401a1591 to your computer and use it in GitHub Desktop.

Select an option

Save limafelipe/c8bcd7c251759a504d21fa0c401a1591 to your computer and use it in GitHub Desktop.

Revisions

  1. Felipe Lima created this gist Jan 16, 2017.
    10 changes: 10 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    function code {
    if [[ $# = 0 ]]
    then
    open -a "Visual Studio Code"
    else
    local argPath="$1"
    [[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
    open -a "Visual Studio Code" "$argPath"
    fi
    }