== App Developer Week -- Making App Development Easy: Gedit Developer Plugins -- sinzui -- Tue, Sep 6th, 2011 == {{{#!irc [18:00] Next up Launchpad legend Curtis Hovey will talk about his developer plugins for Gedit [18:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/06/%23ubuntu-classroom.html following the conclusion of the session. [18:06] What is gedit? [18:06] gedit is a simple text editor [18:06] with support for syntax highlighting [18:06] that can be extended for new uses [18:07] See https://live.gnome.org/Gedit to see a full list of features [18:07] gedit ships with plugins to help power-users [18:07] The gedit-plugins package for provides tools to help developers [18:07] Many developers provide extra plugins for specific development [18:08] See http://live.gnome.org/Gedit/Plugins for a list of plugins supported by gedit 3.x [18:09] Developers will want to install a few packages from Ubuntu universe to get the set of plugins that I recommend and use. [18:09] Using Software Center [18:10] Search gedit plugins [18:10] Show technical items [18:10] install gedit-plugins, gedit-developer-plugins [18:10] Edge and bleeding edge archives provide fixes [18:10] and features several weeks ahead of Ubuntu [18:10] universe [18:11] ppa:sinzui/ppa for what I will propose for Ubuntu, and ppa:sinzui/gdp-unstable for what is being tested--can be dangerous [18:12] Gedit must be configured for development and to use plugins [18:12] Edit > Preferences > View [18:12] * View margin and line numbers [18:12] * Highlight the line and [18:12] * matching bracket [18:12] * Disable text wrapping [18:13] Edit > Preferences > Editor [18:13] * Set the tab width to 4 or 8 spaces per the project you are working on [18:13] * Insert spaces instead of tabs [18:13] * Enable automatic indentation [18:14] Edit > Preferences > Plugins [18:14] Enable: Bookmarks, [18:14] Code comment, Draw [18:14] spaces, File browser, [18:14] panel, GDP Bazaar [18:14] integration, GDP Find, [18:14] GDP Format, GDP [18:14] Syntax, Completer, [18:14] Modelines, Snippets, [18:14] Sort, Spell Checker [18:14] ^ that is only half of the plugins that are installed. There are others that you may want [18:15] There are also competing and overlaping plugins. notably Word Completion, Snippets, and GDP Syntax Completer [18:16] The Draw spaces plugin requires additional configuration to work [18:16] Use the Preferences [18:16] button in the Plugins [18:16] tab to set the kinds [18:16] of white-space you [18:16] want to see: [18:17] Enable/disable the plugin using Menu > View > Show white space [18:17] GDP Syntax completer plugin [18:17] Use Alt+/ to view a list of candidates to replace the text being typed: [18:17] * Python identifiers [18:17] * Open or used xml tags [18:17] * Words in the document [18:18] ^ Alt+/ is not convenient, but it avoids the conflicting accelerator issue upstream [18:19] GDP find and replace plugin [18:20] Search multiple files within a directory Filter on sub-directory or file name fragment [18:20] * Use regular expressions [18:20] * Match case [18:20] * Replace in multiple files (supports REs) [18:20] * Save the list of matches [18:20] The plugin appears in the right panel. [18:21] You can show the side panel from using F9, or Menu > View > Side panel [18:21] The find and replace actions are also in the Search menu [18:22] GDP formating and syntax/style checking [18:23] Menu > Tools > Check style and syntax reports errors and issues in one of more files being edited [18:23] There is special support for Python, Javascript, and CSS [18:24] where syntax errors are reported [18:24] There are actions under Menu > Tools to reformat CSS and doctest files [18:25] Menu > Edit > Format provides [18:25] * text rewrapping [18:25] * Fix line ending [18:25] * tabs to spaces [18:25] * regular expression inline reformatting [18:25] GDP Bazaar integration [18:26] * Branch, edit, commit, and push bazaar projects. [18:26] * bzr-gtk is used to visualize the files and tree [18:26] * Work with SVN, HG, and git branches when the proper bzr plugins are installed [18:28] I also use Source Code Browser pugin: A source code class and function browser based on Exuberant Ctags [18:28] See https://github.com/Quixotix/gedit-source-code-browser [18:29] ^ This, like my own gedit-developer-plugins is transitioning to Gedit 3.x plugin architecture [18:29] Some features of the plugins there are available in natty are not available at this moment in oneiric [18:31] If you are using oneiric, you may have noticed that all plugins in gedit, totem, rhythmbox, and any other libpeas-based application were broken. This was fixed in the last 24 hours [18:31] bzr-gtk is being updated the gtk3. We may see a package for testing this week [18:32] * sinzui is doing the conversion [18:33] The 4 gdp plugins are broken in oneiric with the libpeas fix. I have a fix and it will be released to my unstable ppa in a few hours [18:34] The source browser plugin could do more. It shows the tags for the open file, but it does not yet allow you to search a tags file for a project. [18:35] That is all I have to present. I know quite a bit about gedit, its underlying libraries, plugins, and bzr-gtk. I can answer question on these topics [18:44] bulldog98: there is a vi mode plugin for gedit 2.x [18:45] mohammedalieng: keyboard shortcuts can be enabled for ALL gtk applications by hacking a gconf/dconf config key [18:45] The feature is essentially gtkrc accelerator configs files [18:46] shazzner: gdp syntax completer will complete python and show the ptyhon help(). It needs refinement [18:47] shazzner the display window is broken upstream (in the gtk source view complete code). I am working on a work around or an upstream widget fix [18:49] dpm: gedit-developer-plugins has been in universe since natty and I update it when I see development break. It broke this morning. I already have a fix pushed. I will build and test the package today! [18:49] I think I have answered everyone's question [18:50] There are 10 minutes remaining in the current session. [18:50] bulldog98, gvim (gtk-version) uses gtksourceview2 (the gedit display lib). [18:51] The core gedit app adds undo, find and replace, and plugin support to the core lib [18:52] So gvim just marries gedit display rules with vim's editing rules [18:54] shazzner: one other point. There is a tab/control+space accelerator conflict in Gedit. There is one completer module that other modules provide for, but there was not mechanism to manage which provider is activate. [18:55] I use GDP Syntax Completer and snippet, so I choose the awkward Alt+/ combination :( }}}