SublimeText Configuration for LSST Development

This page will help you configure SublimeText to be consistent with LSST’s coding standards and development practices. We recommend using SublimeText 3, and installing Package Control to manage the many useful SublimeText packages that are available. See the Package Control help for usage, including the command to open the Command Palette on your system. Play with the available color schemes until you find one you prefer: there are many to choose from.


Here is a suggested settings file that will configure Sublime to match most LSST coding styles, plus some that are personal preference but show some of the settings that can be configured. Particularly important are "detect_indentation": false, and "translate_tabs_to_spaces": true,, which will keep your python and C++ code from gaining tabs. The "rulers" setting doesn’t affect actual indentation, but provides guides to help your own line length formatting.

    "bold_folder_labels": true,
    "caret_style": "phase",
    "detect_indentation": false,
    "draw_white_space": "selection",
    "enable_hexadecimal_encoding": false,
    "ensure_newline_at_eof_on_save": true,
    "font face": "inconsolata-g",
    "font_size": 11,
    "highlight_modified_tabs": true,
    "indent_to_bracket": true,
    "open_files_in_new_window": true,
    "translate_tabs_to_spaces": true,
    "wide_caret": true


To easily open files in SublimeText from the command-line, there is a subl command-line helper.

Some packages (installable via Package Control) that may help your development include,

  • Git Gutter to put marks next to the line numbers that identify added/modified/removed lines since the last Git commit.

  • OmniMarkupPreviewer to allow live-view of formatted reStructuredText, Markdown, and so on, in a web browser.


The clang-format plugin can help you automatically keep your C++ in line with the DM C++ Style Guide. Once you have clang-format configured on your system, install the Sublime package with the Package Manager: Clang Format.

There are two required settings to make Clang Format find the binary and configuration file: "binary" and "style": "File". On Ubuntu, binary should be clang-format-5.0, while on macOS it should be /usr/local/bin/clang-format if you installed via Homebrew. In addition, you configure your Clang Format (clang-format.sublime-settings) to automatically format on save.

    "binary": "clang-format-5.0",
    "format_on_save": true,
    "style": "File"

You can also set C++ syntax-specific settings to override the general settings above. Syntax-specific settings are defined by opening a file in the desired language and selecting Preferences -> Settings - Syntax-Specific. For example, to have only one ruler at the C++ boundary:

    "rulers": [110]

These settings override both user and default settings for the C++ syntax.


The built-in python syntax highlighting works well, but here are some potentially useful customizations:


LSST uses flake8 to check that our python code conforms to our DM Python Style Guide. You can get SublimeText to check your python code inline and mark lines that do not follow our style with the SublimeLinter package. Install SublimeLinter and SublimeLinter-flake8 via Package Control (note: packages that are already installed won’t show up in Package Control’s “Install Package” list). Use the following configuration to conform to LSST’s python style, to mark failing lines, and to provide a summary of failures on save that will let you go directly to those lines.

Install flake8 in the python that you will use for lsst development (typically your copy LSST-installed miniconda). Set the executable parameter of SublimeLinter-flake8 to the path to that flake8. Here is an example configuration for SublimeLinter and flake8:

// SublimeLinter Settings - User
    "linters": {
        "flake8": {
            "executable": "<your_miniconda_root_here>/miniconda/envs/lsst-scipipe/bin/flake8",
            "args": [
                // from
                "--max-line-length", "110",
                "--ignore", "E133,E226,E228,N802,N803,N806,N812,N813,N815,N816,W503",
    "show_panel_on_save": "view"

Alternately, instead of configuring line length and the ignore list in SublimeText, you can configure it globally by creating a ~/.config/flake8 file:

# from
ignore = E133, E226, E228, N802, N803, N806, N812, N813, N815, N816, W503
max-line-length = 110

Note that there are SublimeLinter plugins for other languages (e.g. RestructuredText, yaml, javascript) as well.


The LSST python style guide follows PEP8, meaning 4-spaces, no TABs. The settings file given above will help you maintain this: SublimeText defaults to 4-stops Tabs.

To help find extra end-of-line spaces, install the Trailing Spaces Package. An example configuration for it:

    "trailing_spaces_file_max_size": 100000,
    "trailing_spaces_highlight_color": "invalid",
    "trailing_spaces_include_current_line": false,
    "trailing_spaces_include_empty_lines": true