Skip to content

Instantly share code, notes, and snippets.

@timomitchel
Last active July 1, 2019 05:14
Show Gist options
  • Save timomitchel/ee5c3e4ed21459e9a584372f1bbfe91d to your computer and use it in GitHub Desktop.
Save timomitchel/ee5c3e4ed21459e9a584372f1bbfe91d to your computer and use it in GitHub Desktop.
How to configure your editor to open from the command line

Steps to Enable Shell Command

Atom

You can try opening Atom and clicking on the Atom tab to navigate to the Install Shell Commands prompt.

Atom-Shell-Commands

Open a terminal window and type atom .

If the text editor opens, you're done! If it does not then follow the steps below:

If you have already installed Atom, and it is in your applications directory, run this command:

$ which atom

If the return of that command is:

$ which atom
/usr/local/bin/atom

Then the shell command is installed.

You can now run the command:

$ atom .

To open your text editor to the current directory location of your terminal.

If which atom returned nothing like so:

$ which atom
$
  • Follow these Steps:
    • Open Atom manually.
    • Use the shortcut command + shift + p to open your Command Pallete.
    • Type: Window: Install Shell Commands into the pop-up window (this is your Command Pallete for Atom).
    • Enter your computer password when prompted.
    • Restart your terminal and test by running atom . in the terminal in the directory of your choosing.
    • This should open Atom text editor at the directory level you run the command from.

Atom Docs

Sublime

  • If you have already installed Sublime, and it is in your Applications directory, copy and paste this command into your .bash_profile: alias subl='open -a "Sublime Text"'
  • Test By running subl . in your terminal from the direcory of your choice.
  • This should open Sublime text editor at the directory level you run the command from.
  • If you have trouble with this, which many students have - because Sublime has not made this process easy - then follow the instructions here: Alternate Setup

Sublime Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment