ターミナルから Atom や Visual Studio Code を起動する方法
ターミナルから特定のディレクトリやファイルを、 Atom と Visual Studio Code から開けるようにする設定方法についてそれぞれ説明します。
# Atom でカレントディレクトリを開く
atom .
# VSCode でカレントディレクトリを開く
code .
ターミナルから Atom を起動する
Atom のインストール後に、atomというコマンドから起動できるようにエイリアスを貼ります。
-
~/.bash_profileに以下の1行を追加
vim や emacs などから.bash_profileを編集し、以下の1行を追加してください。alias atom="/Applications/Atom.app/Contents/Resources/app/atom.sh" -
source して有効にする
source ~/.bash_profile
上記の手順の実行後、 bash から以下の方法で Atom を起動できます。
atom .
ターミナルから Visual Studio Code を起動する
Visual Studio Code を起動して設定します。
-
Visual Studio Code を起動
-
command+shift+pを押してコマンドパレットを開く。 -
shellと入力してShell Command: Install 'code' command in PATHを選択した状態でEnterでインストール
上記の手順の実行後、 bash から以下の方法で VSCode を起動できます。
code .