[clug] Syntax-highlighting source code editors

Paul Wayper paulway at mabula.net
Fri Jun 27 03:19:04 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

steve jenkin wrote:
| What source code editors do people use that do syntax-highlighting?
|
| I need to be able to handle Borland Pascal (Delphi).
|
| Would like PERL and HTML as well and be able to write a 'lua' or 'tcl'
| syntax as well.
|
| Do I have to go to 'Eclipse'?

I used to use Nedit, and it's a very powerful editor, but somewhat dated in
interface, and it lacks an important feature:

For the last three or so years I've been using Gedit, the standard text editor
in GNOME.  It has syntax highlighting for a bunch of languages including Perl,
Python, Pascal and a huge range of others including HTML, Lua and tcl.  It has
a very useful 'snippets' feature which I've got into - you can write a bunch
of standard text for your style of coding and, upon entering the start word
and hitting TAB, the whole thing is set up for you.  For example, my standard
subroutine setup in Perl looks like:

####################
sub ${1:function_name} {
####################
~    my (${2:$param}) = @_;
~    # ${3:description of subroutine}
~    ${0:# body...}
}

So when I type 'sub' and hit TAB, I get all that and the 'function_name' is
selected for me to replace.  When I replace that and hit TAB I move on to the
param list and so forth.  I can also do things like:

<$1>${2:$GEDIT_SELECTED_TEXT}</$1> $0

For a HTML tag pair: select some text and press Shift-Ctrl-< (defined in the
snippet's activation settings) and I have that text in a tag of my own
choosing.  Then when I replace the $1 with 'P' (for example), the ending $1
also changes to </P>, and then the cursor will move to after the text.

The things that Gedit doesn't do that Nedit does are: allow you to have
multiple 'bookmarks' in the text, allow you to split the window and work in
two places of the same file (incredibly useful when checking on how some other
function in your code should be called) and Gedit's idea of a sensible colour
scheme to develop code in is ugly.

Hope this helps,

Paul
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFIZFwou7W0U8VsXYIRAvCmAKDVTviNLQ339g67CrjDx7KcxfyMJgCeMpl7
/rDSqmmK0Lo5rI1fiUt9Aeo=
=Osn4
-----END PGP SIGNATURE-----


More information about the linux mailing list