Sunday 24 July 2011

SciTE(ing) Numbers

Having recently figured out how to change the default language and turn on line-wrapping in SciTE, I've just got around to amending the SciTE properties file on my laptop. Although I don't do any programming, I thought that it might be useful to turn on the line-numbering function at the same time.

Open a terminal and type:

sudo cp /usr/share/scite/SciTEGlobal.properties /usr/share/scite/SciTEGlobal.properties.bak

This command creates a backup of the SciTEGlobal properties file and saves it with a .bak extension in the same directory as the original. Inexplicably, I omitted this step in my previous post - however, it is always a good idea to create backup copies of system or properties files before making changes!

In order to turn on the line numbering function, we have to amend two properties in the Global Properties file. Using the command line, open the file with:

sudo gedit /usr/share/scite/SciTEGlobal.properties

The first property to change is the line.margin.visible variable. Open a search dialog in gedit (Ctrl + C) and type:

line.margin.visible

All that is required is to un-comment this line (remove the # character from the start of the line) in the SciTEGlobal.properties file. Next, we need to specify that the margin should expand as the number size increases. The line under the line.margin.visible property should be the line.margin.width property with a default value of 4. Change this variable to read:

line.margin.width=3+

Save the changes and close the SciTEGlobal.properties file. When you next start SciTE, you should now have line numbering turned on by default.

Sources & References:

No comments:

Post a Comment