Atom for Pythonist

3 minute read

Atom to downloaded
Atom: A hackable text editor for the 21st Century

Atom is a free and open-source text and source code editor for macOS, Linux, and Microsoft Windows with support for plug-ins written in Node.js, and embedded Git Control, developed by GitHub (Wikipedia).

Atom was launched in February 2014 by the GitHub team.

A hackable text editor for the 21st Century created by GitHub team which is simple, powerful and highly customizable.

Download for 32 bit or 64-bit installer according to your operating system. Once it is downloaded, go to the download folder and double-click on “AtomSetup-x64.exe” for installing it.

Atom to downloaded
AtomSetup-x64.exe

Click on the icon and install the editor as shown below:

Install Atom
Installing Atom

After giving the permission to the windows, a beautiful image will appear with the caption “Atom is being installed. It will launch once it is done”.

Install Atom
Atom editor

Once it is installed, an icon on the desktop will appear. To use Atom, either click on the desktop icon or find the “Atom” in the start menu.


Atom for Pythonist

Pythonist loves Atom, as both are open source. It could be customized for Pythonist by installing six packages:

  1. platform_ide-terminal
  2. autocomplete-python
  3. python-autopep8
  4. linter-flake8
  5. Browser Plus
  6. file-icons

1. platform_ide-terminal

It is a terminal package for Atom for integrating command line in ATOM.

Click on File> Settings>Install "platform-ide-terminal"

install platform-ide-terminal
Installing platform-ide-terminal in Atom editor

It stays at the bottom of the editor. Click on the “plus sign” on the bottom-left side for using it.

For more information click here.

platform-ide-terminal
platform-ide-terminal in function

If you press Ctrl+T or Ctrl+P, the Fuzzy Finder will pop up. This will let you quickly search for any file in your project by typing parts of the path.

2. autocomplete-python

autocomplete-python autocompletes python packages, variables, methods, and functions with their arguments in Atom.

Click on File>Settings>Install autocomplete-python

Install Atom
Installing autocomplete-python

3. python-autopep8

It formats the python code according to the PEP8 guidelines. For more information click here.

Click on the Settings of python-autopep8 and go to the Settings. Check the Format on Save as shown below.

python-autopep8
Installing python-autopep8
  • autopep8 need to be installed on the system. Open bash and type
pip install autopep8

4. linter-flake8

Flake8 is a Python library that wraps PyFlakes, pycodestyle and Ned Batchelder’s McCabe script. It is a great toolkit for checking your code base against coding style (PEP8), programming errors (like “library imported but unused” and “Undefined name”) and to check cyclomatic complexity. For more information click here

python-autopep8
Installing linter-flake8
  • flake8 need to be installed on the system. Open bash and type
pip install flake8

5. Browser Plus

It opens a real browser in ATOM, which is very handy for debugging and checking the output at the same time. It opens the home page(maintained in the settings) or http://www.google.com.

ctrl + shift + P and search Browser Plus for opening the browser window.

python-autopep8
Installing Browser Plus

6. file-icons

This put a little icon next to each file, which helps us to identify which kind of file it is.

python-autopep8
file icons showing the file icon next to it

File-specific icons in Atom for improved visual grepping.

python-autopep8
file icons showing the file icon next to it

Open File with Atom in one click

The normal procedure for opening a file or a directory with Atom is by first opening the editor Atom, with either of two methods as mentioned above. Then click on “File” > “Open folder” and browse to the file or the folder, which is a very cumbersome process as shown below:

Install Atom
Atom editor

Wouldn’t it be amazing if we could just open the file in one click? So let see how we can do it.

  1. Open the editor Atom
  2. Click on File > Settings and Click “System” tab. Check the Show in file context menus and Show in folder context menus as shown below:
  3. Close the editor Atom.
Install Atom
Atom’s System tab

Right click and “open with Atom” option will appear as shown below. Atom is available with just a right click away.

Install Atom
Open with Atom option available on right click

Conclusion

We have learned about a wonderful open source editor called Atom. How it is being used by Pythonist and some tricks and tips about using it.


References and further reading list

  1. wikipedia
  2. Atom
  3. platform-ide-terminal
  4. python-autopep8
  5. linter-flake8

Leave a comment