Andrew Jaffe
Andrew Jaffe

Reputation: 27087

Command-line alias for Visual Studio Code on OS X with CSH?

The VS Code editor is nice, and I'm looking forward to using it to learn a bit more about javascript and node.js. The installation instructions describe the setup for bash-like shells, but I am a savage and would like to use it with csh. I can probably hack something together, but is there an obvious translation of

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* }

into a csh alias?

I think this sort of works:

alias code "setenv VSCODE_CWD ${PWD} && open -n -b "com.microsoft.VSCode" --args $*"

but I think I really want a way to make VSCODE_CWD "local" to the alias, as in the bash version.

Upvotes: 5

Views: 2893

Answers (1)

João Moreno
João Moreno

Reputation: 691

You can also create a code script in your PATH with the contents:

#!/bin/sh
VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $*

Upvotes: 3

Related Questions