macOS ターミナルから VSCode を実行する

ターミナルから VSCode を実行する

ターミナルで特定のディレクトリに移動し、特定のファイルを開くことができる。

$ code [File path]

設定方法は次のとおりである。

  1. Visual Studio Code を起動する。
  2. Command Palette (⇧⌘P) を押すと、コマンドパレットが開く。
  3. shell command と入力し、Shell Command: Install 'code' command in PATH を見つけて実行する。