Visual Studio Code
Visual Studio Code is a
free editor application (similar to Atom) that works for all three major
operating systems (Windows, Mac, Linux) and has the ability to edit remote
files; that is, to edit files on a machine that you would have to SSH to.
Very cool!
Installation on a Mac
- Download the VSC application (for the Mac) from
the homepage
or download page.
- Install the application, by clicking the icon for the .zip file in the Downloads folder. You'll see something like this:
- Double-click the unzipped application in the finder window.
- Approve the opening of the application by clicking "open"
- The application will launch and then automatically open some documentation windows.
- Go to
the Extension
page and install the Remote Development extension. We will probably
install other extensions later. You'll have to click a few
confirmation windows, including a final green "install" button in the
VSC application itself:
- I suggest right-clicking on the icon in the Dock and clicking "Options / Keep in Dock".
SSH Usage
After the installation steps above, and after launching the VSC application, you can use it to edit remote files:
- In the lower left of the VSC window, you'll see a green icon that
looks like this:
- Click on the green icon (hover says: "open a remote window"). At the top of VSC, you'll see a menu like this:
- Choose "Remote-SSH: Connect to Host" and connect
to
youraccount@cs.wellesley.edu
. Looks like this:
- It'll ask for your password in the next step.
- If you succeed, the lower left of the VSC window will show the remote connection, like this:
Navigation
Editing files on the remote machine is pretty straightforward:
- Click on the Explorer Icon (or command-shift-e)
- Choose "Open Folder" under connected SSH
- Choose a folder on your remote machine, such as
public_html
SSH Terminal
To run commands on the remote machine, you'll need a terminal:
- On the Terminal menu, choose "New Terminal". This opens a remote (SSH) terminal!
- cd to
public_html
- do an
ls
to see your files and folders
Exit
- logout from your terminal window, and
- click on the remote session icon and choose "Close remote connection"
- quit VSC
SSH Keys
Later, we'll talk about SSH keys, to avoid having to constantly re-authenticate.
-
This work is licensed under a Creative Commons
License
-