Atom text editor configuration

Configure Atom

Turn off auto-indent on paste to stop Atom reformatting your code.

  1. In the Atom menu select Preferences
  2. On the left side select Editor
    • Uncheck Auto Indent On Paste
    • Check Show Indent Guide
    • Set Tab Type to soft to place 2 spaces when you press the tab key

Atom language packs

Atom language packs help you with code completion.

Install language packs

  1. In the Atom menu select Preferences…
  2. On the left select Install, and type the name of the language pack into the text box and hit enter. Click the Install button to install the language pack.
    – language-chef
    – language-inspec

How to use language packs

  1. Start to type the name of the resource, and a list appears with the matching resources.
  2. Select the resource in the list with the cursor keys and press tab to insert the code snippet
  3. Make the appropriate changes to customize the resource.

Line endings

Set Atom to always use “LF” as the line ending.

  1. In the Atom menu select Preferences
  2. On the left side select Packages
  3. Select the line-ending-selector package
  4. Set the Default line ending to LF

Configure Atom to insert tabs into the Makefile

Makefiles need tabs instead of spaces otherwise we get the error message

Makefile:2: *** missing separator. Stop.

To configure Atom to always use tabs in Makefile

  1. Set the Tab Type to auto in the Atom settings
  2. Install Editorconfig with
    apm install editorconfig
  3. Create the .editorconfig file in the root of your project directories (~/Git) with the content
    [Makefile]
    indent_style = tab
    
    [*.yml]
    indent_style = space
    indent_size = 2
  4. Restart Atom

Leave a comment

Leave a Reply