Wednesday, August 13, 2008

Gedit as an Editor for Programmers

Gedit is a lightweight and powerful text editor. It is included in Ubuntu Linux. Gedit supports plugins, so you can add some plugins to extend your editor. With plugins, Gedit is not only a simple text editor.
As a programmer's editor, it should show line numbers, enable automatic indentation, etc. Open "Edit" -> "Preferences". There are for tabs in the dialog. You'd better go to "View" tab and check "Display line numbers" and "Highlight matching bracket". Next, check "Enable automatic indentation" in the "Editor" tab.

"Plugins" tab is used for enabling and disabling Gedit's plugins. Open "Plugins" tab, then you can find the installed plugins. So please check which plugins you have installed firstly. If what you need has not been installed, please visit http://live.gnome.org/Gedit/Plugins. To install a plugin is very easy. Just extract the files to ~/.gnome2/gedit/plugins/ then restart Gedit. I think the following plugins are useful for programming:
  • Code comment: It adds "Comment code" and "Uncomment code" to the "Edit" menu. It can help you comment and uncomment code quickly.
  • Color Picker: If you enable this plugin, "Pick color..." will be added to the "Tools" menu. It opens gcolor2 to help you to choose color. If you don't have "gcolor2", you need to run "sudo apt-get install gcolor2" to install it first..
  • Embedded Terminal: It adds a terminal frame in the bottom pane. You can use "Ctrl+F9" to toggle it.
  • File Browser Pane: It adds a simple file browser into the left pane.
  • Indent Lines: After turn on this plugins, you will find "Indent" and "Unindent" options in the "Edit" menu. It can increase or decrease indentation quickly.
  • Split View 2: "Toggle Split View" will be added to the "View" menu. You can split the document frame and see more that one file at the same time.
  • Symbol Browser: It is added to left pane. When you open a source code file, it can show the classes and functions, etc. It is very useful for programming.
  • Tag List: Some common tags for HTML, XML, etc.
Gedit plugins can be written in C or Python. If you want to write your own plugins, read C plugin howto and Python plugin howto.

1 comment:

Unknown said...

I've been using gedit for long. If you install KDE components as well you will get a plug-in-ready gedit. It can be started via different links. The appearances will be different in accord with intended programming languague.