Gedit Symbol Browser Plugin

I have written a symbol browser (function browser, class browser, etc.) plugin for Gedit, the default GNOME text editor. The plugin is based on Exuberant Ctags (ctags.sourceforge.net) which must be installed to use the plugin.

This plugin is for Gedit 2.x only. For a Gedit 3 / GNOME 3 version of this plugin, see my Gedit 3 Source Code Browser plugin.

Function Browser for Gedit

Features

View Screen Shots
  • Supports 34 programming languages (based on ctags)
  • Symbols displayed in a tree grouped by symbol type
  • Icons for symbols can be added for any symbol type ctags can parse
  • Works with local and remote files (SSH, FTP, etc.)
  • View symbols from active tab or from all opened documents
  • Optionally show line number, programming language, and source file in the tree
  • Double-click a symbol to jump to it in the source code

Installation

The plugin is written in C and thus needs to be compiled with the Gedit sources for your distribution if a binary package isn't available. You can check which binary packages are available on the Gedit Symbol Browser Plugin SourceForge project page. Binary Installation
cp gedit-symbol-browser-plugin*.tar.gz ~/.gnome2/gedit/
tar -xzf gedit-symbol-browser-plugin*.tar.gz
Source Installation If a binary package isn't available, you have to compile the plugin yourself. If you do so, please email the plugin files to me at email (at) micahcarrick.com so that I can provide a binary package. To compile the plugin, you must do so within the gedit source tree. Then, you can either install it with that build of gedit or copy the files yourself without compiling or installing gedit. Download and extract the gedit sources to a folder. Download Gedit Symbol Browser Plugin sources and extract to the gedit sources plugins folder (ex: gedit-2.20.3/plugins/). Edit configure.ac, adding 2 lines to AC_CONFIG_FILES
plugins/symbolbrowser/Makefile
plugins/symbolbrowser/symbols/Makefile
Edit plugins/Makefile.am, adding to 'symbolbrowser' to DIST_SUBDIRS and SUBDIRS. Run autoconf and automake, and ./configure in the gedit source dir and then make in the symbolbrowser plugin dir:
autoconf
automake
./configure
cd plugins/symbolbrowser
make
Now if you were to run 'make install' here, it might not install the plugin to the right location. This is because many distributions, by default, install binary (rpm's, dep's, etc.) into a different location that files built from source (/usr/ vs. /usr/local/). So, the easiest way to install the plugin is to simply copy plugin files to your home dir:
cp symbolbrowser.gedit-plugin .libs/libsymbolbrowser.so ~/.gnome2/gedit/plugins/
cp -r symbols ~/.gnome2/gedit/
If you want to install it for all users using 'make install', you'll have to pass the target during the ./configure step. You can find out where the other gedit plugins are already installed by doing:
updatedb
locate gedit-2/plugins
And look for them in something like /usr/lib. Then, you can rerun the configure as shown above passing in the lib dir:
./configure --libdir=/usr/lib
Assuming you're okay with the simpler method (installing the plugin in your home dir), the entire process might look something like this:
# DOWNLOAD AND EXTRACT SOURCES
cd ~
wget ftp://ftp.acc.umu.se/pub/GNOME/sources/gedit/2.20/gedit-2.20.3.tar.gz
tar -xzf gedit-2.20.3.tar.gz
cd gedit-2.20.3
cd plugins
wget http://superb-west.dl.sourceforge.net/sourceforge/symbol-browser/gedit-symbol-browser-plugin-0.1.tar.gz
tar -xzf gedit-symbol-browser-plugin-0.1.tar.gz

# EDIT MAKE AND CONFIGURE FILES
sed -i 's/SUBDIRS =/SUBDIRS = \t\\\n\tsymbolbrowser\t/g' Makefile.am
sed -i 's/DIST_SUBDIRS =/DIST_SUBDIRS =\t\\\n\tsymbolbrowser\t/g' Makefile.am
cd ..
sed -i 's/AC_CONFIG_FILES(\[/AC_CONFIG_FILES(\[\nplugins\/symbolbrowser\/Makefile/g' configure.ac

# BUILD THE PLUGIN
autoconf
automake
./configure
cd plugins/symbolbrowser
make

# COPY TO HOME FOLDER 
# Note: if you ran ./configure --libdir=/usr/lib then make install may work
cp symbolbrowser.gedit-plugin .libs/libsymbolbrowser.so ~/.gnome2/gedit/plugins/
cp -r symbols ~/.gnome2/gedit/

Adding Symbols

If ctags finds a type of symbol, then Gedit Symbol Browser Plugin adds it to the tree view. If it doesn't find the icon for that symbol you can add it yourself if you wish (send them to me too!). All symbol icons are simply named "symbol-<type>.png" and live in the '~./gnome2/gedit/symbols' directory where <type> is the type as determined by ctags. For example, ctags finds symbols of type 'function' and therefore, there is a png file called 'symbol-function.png'.

Download

Download Paypal IPN Script Download From SourceForge.net

User Contributions

Did you enjoy Gedit Symbol Browser Plugin? If you would like to help support my work, A donation of a buck or two would be very much appreciated.
blog comments powered by Disqus
Linux Servers on the Cloud IN MINUTES