├── .gitignore ├── README.md └── vscode.plugin.zsh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Visual Studio Code 2 | 3 | Plugin for Visual Studio Code, a text editor for Mac OS X, Windows, and Linux 4 | 5 | ### Requirements 6 | 7 | * [Visual Studio Code](https://code.visualstudio.com) 8 | 9 | ### Usage 10 | 11 | * If the `code` command is called without an argument, launch VS Code 12 | 13 | * If `code` is passed a directory, cd to it and open it in VS Code 14 | 15 | * If `code` is passed a file, open it in VS Code 16 | 17 | *NOTE: `vscode` can be used as an alias in place of `code`* -------------------------------------------------------------------------------- /vscode.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias vscode='code' 2 | 3 | # 4 | # If the code command is called without an argument, launch VS Code 5 | # If code is passed a directory, cd to it and open it in VS Code 6 | # If code is passed a file, open it in VS code 7 | # 8 | function code { 9 | if [[ $# = 0 ]] 10 | then 11 | open_command -a "Visual Studio Code" 12 | else 13 | local argPath="$1" 14 | [[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}" 15 | open_command -a "Visual Studio Code" "$argPath" 16 | fi 17 | } --------------------------------------------------------------------------------