Ruby on Rails
Scite

About SciTE

SciTE is a Scintilla-based Text Editor written for Windows and Linux/UN*X. It is included in some versions of Ruby.

SciTE on Windows

After Ruby has been installed using the One-Click Installer , SciTE is installed (by default) in C:\Ruby\Scite. Here are some tips for using SciTE on Windows.

Create a file named e.bat or scite.bat in your C:\Windows directory containing the lines:
@ECHO OFF START c:\ruby\scite\scite.exe "%1"

This will allow you to type e myfile or scite myfile on the command line to open up the file myfile for editing.

Abbreviations in SciTE

This section contains some useful abbreviations that can be added to the abbrev.properties file.

rea=redirect_to :action => "|" 
rec=redirect_to :controller => "|" 
lic=<%= link_to "|", :controller => "" %>
lia=<%= link_to "|", :action => "" %>

Hopefully in the future, SciTE will support TextMate-style snippets that allow the user to tab between fields in a statement (see this page for more info)

category: Glossary


Anyone who has syntax hilighting for rhtml/rjs files? Please :-)



Here is how I’ve set up Scite for Rails development

To the file .SciTEUser.properties in your home directory, add the following:

command.name.3.$(file.patterns.rb)=beautify
command.3.$(file.patterns.rb)=/usr/local/bin/rbeautify.rb  $(FilePath)
command.is.filter.3.$(file.patterns.rb)=1

This adds a command ctrl-3 to “pretty print” your ruby source code. This is very useful to keep your code nicely formatted. You will need rbeautify.rb , an executable shell script in your path. You can find rbeautify.rb
here:

rbeautify.rb

Be sure rbeautfiy.rb is in your path and is executable and that the first line of rbeautify.rb is pointing to ruby.

Also be sure you have ruby.properties in your scite directory which is found at:

/usr/local/share
or
/sw/share (Mac OS X with Fink Linux)

Also see this excellent article:

Develop Ruby Applications Using SciTE ditor

ruby.properties is installed when you install scite (I believe).

Regards, John Rothfield john@rothfield.com

TextMate-style snippets for SciTE do exist.

Civ2boss, 07/27/06, 12:42 AM

Thanks John, very nice pretty print tool, Mancy