GNOME Builder snippets improvement

Did you know that GNOME Builder support snippets? I didn’t.

I made 4 snippets for RPM Spec files to get spec skeleton: minimal, library, python-arch, python-noarch. You can start typing one of this, press ENTER and see how this magic works. It’s very useful when you packaging something to avoid calling rpmdev-newspec with parameters, opening editor, manual walking by lines and etc.

Also I added some basic snippets for Python files: class/function definition, interpreter line, main function and import. This helps me to more faster write code.

P.S. there some cool C snippets like gobject and main

P.P.S. for switch to next field you want to press Tab

GNOME Builder and python: happy indents

Christian Hergert, author of GNOME Builder, in yesterday morning got some messages from me about auto-indent problems in Python.

According to PEP 8 we can use:

# Aligned with opening delimiter.
foo = long_function_name(var_one, var_two,
                         var_three, var_four)

# More indentation included to distinguish this from the rest.
def long_function_name(
        var_one, var_two, var_three,

# Hanging indents should add a level.
foo = long_function_name(
    var_one, var_two,
    var_three, var_four)

Christian added support for auto-indenting for all this cases. I can just write code and don’t care about indentation. You want to try GNOME Builder!

P.S. There are cool Shift-Tab keybinding to remove one tab (4 spaces or whatever)