Atom editor and C++

With recent update of the Atom editor from GitHub, developing C++ application just started to be more pleasant. Enhancing the editor with packages which use clang tools enables features for easy and quick program writing, good for creating proof of concept applications.


On homepage for Atom,, there are precompiled packages to download as well as the source code. I use Linux Mint, which is based on Ubuntu and uses apt package manager, so below instructions add an apt source for easy updates.

Add atom ppa repository

sudo add-apt-repository ppa:webupd8team/atom

Update apt package db and install atom

sudo apt update && sudo apt install atom

Enhancing Atom with packages

Installing packages is very easy in Atom. For C++ development I use packages which use clang and clang tools, those need to be installed separately, check apt source for clang.

List of packages


The autocomplete packages are very helpful when using STL components. Linter helps quickly discover mistakes, potential bugs when typing.

I use CMake to generate the appropriate build files, so that I can just type ‘make’ and rebuild the application. Autocomplete for cmake helps a lot when adding new instructions, which sometimes are long.


For quicker program writing, I like to use snippets. I added two for now to help me quickly setup a new program folder. One with main function and one with CMake instructions.

Adding new snippets is easy. Edit -> Snippets…

    'Minimum CMake File':
        'prefix': 'cmake'
        'body': '''
            cmake_minimum_required(VERSION 2.8.12)
            set(CMAKE_CXX_STANDARD 11)
            file(GLOB SRC *.cpp)
            add_executable(main ${SRC})

    'Minimal C++ program':
        'prefix': 'cmin'
        'body': '''
            #include <iostream>

            using namespace std;

            int main(int argc, char *argv[])

                return 0;


To use above snippets simply type ‘cmin’ in a C++ file for the minimal C++ program and ‘cmake’ in CMakeLists.txt for minimal CMake instructions set needed to compile the project.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s