Editing Gedit

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[http://projects.gnome.org/gedit/ Gedit] is the Gnome text editor. There are many plugins and options that may be able to improve your coding experience.
Gedit is the Gnome text editor. There's many plugins and options that may be able to improve your experience while coding with octave.


== Syntax Highlighting ==
== syntax highlight ==
Gedit has very good syntax highlighting for GNU octave, specially since v3 when it was split into matlab and octave. It uses gtksourceview for it and the latest lang file can be downloaded from [http://git.gnome.org/browse/gtksourceview/plain/data/language-specs/octave.lang their repository].
Gedit has very good syntax highlight for GNU octave, specially since v3 when it was split into matlab and octave. It uses gtksourceview for it and the latest lang file can be downloaded from [http://git.gnome.org/browse/gtksourceview/plain/data/language-specs/octave.lang | their repository].


Note that since matlab and GNU octave files have the same mimetypes and globs in gedit, your files may be highlighted using matlab rules. To easiest way to fix this is removing {{Path|matlab.lang}}. The same happens with functions files which may be highlighted as Objective-C which can also be fixed by removing {{Path|objc.lang}}. However, system updates may recreate these files and so you may want to keep removing these files. The lang files usually reside at {{Path|/usr/share/gtksourceview-3.0/language-specs/}}
Note that since matlab and GNU octave files have the same mimetypes and globs in gedit, your files may be highlighted using matlab rules. To easiest way to fix this is removing {{Path|matlab.lang}}. The same happens with functions files which may be highlighted as Objective-C which can also be fixed by removing {{Path|objc.lang}}. However, system updates may recreate these files and so you may want to keep removing these files. The lang files usually reside at {{Path|/usr/share/gtksourceview-3.0/language-specs/}}


== Code comment ==
== Code comment ==
One of the most useful plugins is '''code comment''' which allows to comment/uncomment several lines of code at the same. Simply select the lines and press {{Key|Ctr+M}} to comment and {{Key|Shift+Ctr+M}} to uncomment. There's one limitation though. While the syntax correctly recognizes both {{Codeline|%}} and {{Codeline|#}} as comment characters, the plugin must use only one. By default it uses {{Codeline|#}}. If you want to change it to {{Codeline|%}}, edit the file with the syntax highlight rule and in the metadata field change the value of {{Codeline|line-comment-start}}:
One of the most useful plugins is '''code comment''' which allows to comment/uncomment several lines of code at the same. Simply select the lines and press '''Ctr+M''' to comment and '''Shift+Ctr+M''' to uncomment. There's one limitation though. While the syntax correctly recognizes both <code>%</code> and <code>#</code> as comment characters, the plugin must use only one. By default it uses <code>#</code>. If you want to change it to <code>%</code>, edit the file with the syntax highlight rule and in the metadata field change the value of ''line-comment-start'':


  <property name="line-comment-start">#</property>
  <property name="line-comment-start">#</property>


== Embedded Terminal ==
== Embedded Terminal ==
Line 27: Line 28:
  >        bottom.remove_item(self._panel)
  >        bottom.remove_item(self._panel)


Basically replace {{Codeline|window.get_bottom_panel()}} with {{Codeline|window.get_side_panel()}}. You might want to replace the {{Codeline|side}} variable name to {{Codeline|bottom}} but that is not actually necessary, it's only so that the variables name reflect the truth about them. The same hack can be used on other plugins to move them between the panels.
Basically replace '''window.get_bottom_panel()''' with '''window.get_side_panel()'''. You might want to replace the '''side''' varname to '''bottom''' but that is not actually necessary. The same hack can be used on other plugins to move them between the panels.


== File Browser on side panel ==
== File Browser on side panel ==


Another useful plugin is the '''File browser pane''' that allows to easily access files from the side pane and navigate into directories to see the paths. Would be great to implement a new one, octave specific, with all the paths in the function search path.
Another useful plugin is the '''File browser pane''' that allows to easily access files from the side pane and navigate into directories to see the paths. Would be great to implement a new one, octave specific, with all the paths in the function search path.
[[Category:Editors]]
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: