Making SciTE Play Nice With Moodle’s Coding Guide Lines

The Moodle community has a long list of specific guide lines for how to write and format your code, most of witch are there for a good reason or to ensure similar coding styles. However one of theses rules specified that all indentations be exactly four spaces and no tab characters be used in the document at all.

Although doing this by hand is possible in a simple editor, the IDE i am using, SciTE, likes to auto indent lines with tabs and even if it did not it would be a pain to count out four spaces each time you need to indent. Lucky there is a way to make SciTE do this for you and ensure all tabs and indentations are four spaces even if you hit the tab key.

All you have to do is add the fallowing to the user options file, /home/yourusername/.SciTEUser.properties :

# Indentation
tabsize=4
indent.size=4
use.tabs=0
indent.auto=1
indent.automatic=1
indent.opening=0
indent.closing=0
tab.indents=1
backspace.unindents=1

This will ensure that your indents are four spaces, will change any tabs it sees to four spaces and auto indent code for you as you type it. Also you will only have to hit backspace once to remove a four space indentation rather then four times.

2 Responses to “Making SciTE Play Nice With Moodle’s Coding Guide Lines”

  1. The Third Bit » Blog Archive » Another Week of Progress Says:

    […] Servos has figured out how to make SciTE play nicely with Moodle’s coding standards. More importantly, he has a demo version of a text UI for visualizing Moodle stats. (Log in as […]

  2. cheap cool grey Says:

    Although doing this by hand is possible in a simple editor, the IDE i am using, SciTE, likes to auto indent lines with tabs and even if it did not it would be a pain to count out four spaces each time you need to indent. Lucky there is a way to make SciTE do this for you and ensure all tabs and indentations are four spaces even if you hit the tab key.

    All you have to do is add the fallowing to the user options file, /home/yourusername/.SciTEUser.properties :

Leave a Reply