Kate is a multi-document, multi-view text editor for KDE. Very well adapted to octave. Features syntax highlighting, embedded terminal, and much more.
Either Matlab or Octave syntax highlighting for m-file can be chosen in
The default for *.m files can be defined to be octave by going to
Settings/Configure kate/Editor Component/"Open/Save"/Modes & filetypes
and setting Priority 0 for Filetype : Scientific/Matlab and Priority 1 for Filetype : Scientific/Octave (the important is that it is higher than the Matlab one)
Kate can comment/uncomment several lines of code at the same time. Simply select the lines and pressto comment and to uncomment.
For the current (april 2012) default (octave.xml version 1.01), the added comment start at the beginning of the line.
In order to have the # to begin like the indented text, just patch /usr/share/kde4/apps/katepart/syntax/octave.xml. First save the following file in /tmp for instance
The last change is not relevant for the comments.
Quit kate, then, as root,
cd /usr/share/kde4/apps/katepart/syntax/ && patch -p7 --backup < /tmp/kate_highlight_octave.xml.patch