Installing and Configuring Atom

Of the many text editor programs out there, one of the best for front-end development is the Atom editor by GitHub. It is a good choice because it is highly configurable, has many plug-ins to help with writing code, and is free to download and use.

You can download Atom for Mac or Windows from atom.io (Figure 1.2).

Figure 1.2  Downloading Atom

Downloading Atom

Follow the installation instructions for your platform. After Atom is installed, there are several plug-ins you will want to install as well.

Atom plug-ins

The primary things you want out of your text editor are documentation lookup, autocompletion, code formatting, and code linting (more on that in a bit). Atom gives you some of these features by default, but installing a few plug-ins will make it even better.

Open Atom and reveal its Settings screen. On a Mac, this is done by choosing AtomPreferences... or using the keyboard shortcut Command-, (that is, the Command key plus the comma). On Windows, you can access it via FileSettings or using the keyboard shortcut Ctrl-,.

On the lefthand side of the Settings screen, click + Install (Figure 1.3).

Figure 1.3  Atom’s Install Packages screen

Atom’s Install Packages screen

Here, you can search for plug-in packages by name. Begin by searching for emmet.

Writing a lot of HTML can be very tedious and is error-prone. The emmet plug-in (Figure 1.4) lets you write well-formatted HTML using a convenient shorthand. Click the Install button to get emmet.

Figure 1.4  Installing emmet

Installing emmet

Next, search for atom-beautify. The atom-beautify plug-in (Figure 1.5) helps with the indentation of your code, which helps with readability. Again, click Install to get this plug-in.

Figure 1.5  Installing atom-beautify

Installing atom-beautify

Search for and install the autocomplete-paths plug-in (Figure 1.6). Very often, your code will need to refer to other files and folders in your project. This plug-in helps by offering filenames in an autocomplete menu as you type.

Figure 1.6  Installing autocomplete-paths

Installing autocomplete-paths

Your next plug-in to install is the api-docs package (Figure 1.7), which lets you look up documentation based on keyword. It displays the documentation in a separate tab in the editor.

Figure 1.7  Installing api-docs

Installing api-docs

Next, search for and install the linter package (Figure 1.8). A linter is a program that checks the syntax and style of your code. Make sure you find and install the package that is just named linter. This is a base linter that works with language-specific plug-ins. You will need it in order to use the other linter plug-ins below.

Figure 1.8  Installing linter

Installing linter

There are three companions to linter that you will want to install to check your CSS, HTML, and JavaScript code. Start with linter-csslint (Figure 1.9), which ensures that your CSS is syntactically correct and also offers suggestions about writing performant CSS.

Figure 1.9  Installing linter-csslint

Installing linter-csslint

The next linter companion plug-in to install is linter-htmlhint (Figure 1.10), which confirms that your HTML is well formed. It will warn you about mismatched HTML tags.

Figure 1.10  Installing linter-htmlhint

Installing linter-htmlhint

The last linter companion plug-in to install is linter-eslint (Figure 1.11). This plug-in checks the syntax of your JavaScript and can be configured to check the style and formatting of your code (for example, how many spaces lines are indented or how many blank lines come before and after comments).

Figure 1.11  Installing linter-eslint

Installing linter-eslint

Chrome and Atom are now ready for front-end development. There are just a few more steps to completing your coding environment: accessing documentation, learning command-line basics, and downloading two final tools.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.168.203