Atom Text Editor

Text editors are a type of program used for editing plain text files; they are a deceptively simple tool that have a wide variety of applications. There are many, many text editors available, but this article will concern itself with the installation, use, and modification of a free, open-source editor developed by GitHub, called Atom. 

Downloading Atom

The first step is, of course, to download the program. You can find it on Atom's website. Although the site should detect which operating system you're using automatically and offer you a download for the appropriate form, you can find others by clicking "Other platforms" below the main download button. 

Once you've downloaded the file, install using your operating system's appropriate method. 

Initial Setup

Frankly, there is little initial setup to do. Once you've install the program, simply open it up and you will see a screen similar to this:

It's a good idea to close out of all the tabs. This can be done similarly to closing out of tabs in web browsers—tabs in Atom work the same way. To spare yourself this in the future, you can uncheck "Show Welcome Guide when opening Atom" before closing that tab.

Basics

In case you're unfamiliar with text editors in general, it might be useful to give an overview of their general layout. Below is a picture of Atom's default, empty layout.

If you don't see the Projects pane on the left-hand side, you can open it by pressing CMD + \ on Macs, or CTRL + \ on Windows computers. This pane shows the contents of your Project folders, which are essentially just folders on your machine that you want to use Atom to edit. Of course, it's empty right now because we don't have any projects open. Let's change that. From the File menu, click Add Project Folder. This can be used to open existing folders, but for the purpose of this tutorial we are going to make a new one. Create a folder in whichever directory you like, and name it Test. Open the folder and you should now see it in the Project pane, as shown below.

This project isn't very exciting since it doesn't have any files. Let's make one called! Right-click the Test folder in the Project pane and click New file. Enter the file name—let's make it foo.txt—and pres enter. Voila, there's our file. You can put some text in it if you want. You'll see in the right-hand tab that we're now editing foo.txt because its name is up in the tab section.

One of the neat things about Atom is that, like many text editors, it recognizes a large number of programming languages. Atom automatically will detect most languages from the file extension; since foo.txt was a text file, there's not much interepreting Atom can do with that. Let's see how it works if we edit another type of file.

Right-click foo.txt and hit "Duplicate," and name the copy bar.sh. Now notice that in the bottom-right corner it says Shell Script where it used to say Plain Text. (You can also click on this and override the default language to any other language.)

Plugins 

One of the handy things about Atom is that there are a huge number of community-made plugins available for it. One such plugin that is particularly useful in our context is called remote-ftp. This allows the user to connect via (S)FTP and make changes directly to the server, without the need to download/upload, like is necessary in command-line (S)FTP connections.

To install a plugin, go to Preferences (File > Settings on Windows). This will bring up a new tab in the editor pane called Settings. On the left side, click the Install option. This will bring up the following page:

The packages displayed here are, as the title implies, featured ones. Feel free to install them by hitting the Install button if you're interested. 

remote-ftp Plugin

To install the remote-ftp plugin discussed above, click the Search packages field and type remote-ftp. It should be the first in a list of plugins that comes up. Install it by hitting Install. This should just take a few moments. One it's installed, it should appear like this in the package list.

Now we're in business. At this point you can exit out of the Settings tab. 

Creating a Project

(Typically macOS users can ignore this step, though it may be something to try as a troubleshooting step.)

In order for remote-sftp to run correctly, it is necessary to create it as a project. Basically a project is Atom's term for a folder; open projects/folders appear in the tree view on the left-hand pane. This is ordinarily done automatically on the macOS version of the program but, in case it isn't, the steps are similar. On PCs, generally this must be done manually.

First, go to File > Add Project Folder... (or Ctrl+Shift+O). In the window that opens, navigate to C:\Users\name.#\.atom\packages\remote-ftp and hit Open. If the project doesn't appear in the left-hand pane, close out of Atom and launch it again. It should appear then.

Connection Configuration

Now that we have the project folder created, go to Packages > Remote FTP and click Toggle. You should see another tab appear in the left-hand pane, right beside the Projects tab. Click on it and you should see something similar to this.

Finally, we need to configure the connection and tell Remote FTP where it's going to connect to. In the top toolbar, go to Packages > Remote FTP and click Create SFTP config file. This should automatically create and open file called .ftpconfig, which is in your Remote FTP project folder.

The default configuration file looks like this: 

You will want to change the host field to the server you're connecting to, the user field to your name.# (or other username). It's generally not a good idea to save passwords in plain text like this, so go ahead and remove "pass" from between the quotes and change promptForPass from false to true. This will prompt you to enter your password every time the connection is made. Save .ftpconfig and close out of it, and click Connect in the Remote tab. 

If everything was done correctly, you should be prompted for your password. Once you correctly enter it, you should get a message saying the connection was successful and the Remote tab changes to look like this:

While the contents will, of course, be different for you, this should display your home directory on the server you connected to. You can now edit these just as you would any other file, and changes saved in Atom will be reflected on the remote server.
 

Details

Article ID: 48321
Created
Mon 2/12/18 3:59 PM
Modified
Sun 3/31/24 2:04 PM

Related Articles (1)

An overview of the central web hosting service, located at www.asc.ohio-state.edu.