MakingAppDevelopmentEasyGeditDeveloperPlugins

App Developer Week -- Making App Development Easy: Gedit Developer Plugins -- sinzui -- Tue, Sep 6th, 2011

   1 [18:00] <dpm> Next up Launchpad legend Curtis Hovey will talk about his developer plugins for Gedit
   2 [18:00] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/06/%23ubuntu-classroom.html following the conclusion of the session.
   3 [18:06] <sinzui>  What is gedit?
   4 [18:06] <sinzui> gedit is a simple text editor
   5 [18:06] <sinzui>  with support for syntax highlighting
   6 [18:06] <sinzui>  that can be extended for new uses
   7 [18:07] <sinzui> See https://live.gnome.org/Gedit to see a full list of features
   8 [18:07] <sinzui> gedit ships with plugins to help power-users
   9 [18:07] <sinzui>  The gedit-plugins package for provides tools to help developers
  10 [18:07] <sinzui>  Many developers provide extra plugins for specific development
  11 [18:08] <sinzui> See http://live.gnome.org/Gedit/Plugins for a list of plugins supported by gedit 3.x
  12 [18:09] <sinzui> Developers will want to install a few packages from Ubuntu universe to get the set of plugins that I recommend and use.
  13 [18:09] <sinzui> Using Software Center
  14 [18:10] <sinzui> Search gedit plugins
  15 [18:10] <sinzui> Show technical items
  16 [18:10] <sinzui> install gedit-plugins, gedit-developer-plugins
  17 [18:10] <sinzui> Edge and bleeding edge archives provide fixes
  18 [18:10] <sinzui> and features several weeks ahead of Ubuntu
  19 [18:10] <sinzui> universe
  20 [18:11] <sinzui> ppa:sinzui/ppa for what I will propose for Ubuntu, and ppa:sinzui/gdp-unstable for what is being tested--can be dangerous
  21 [18:12] <sinzui> Gedit must be configured for development and to use plugins
  22 [18:12] <sinzui> Edit > Preferences > View
  23 [18:12] <sinzui> * View margin and line numbers
  24 [18:12] <sinzui> * Highlight the line and
  25 [18:12] <sinzui> * matching bracket
  26 [18:12] <sinzui> * Disable text wrapping
  27 [18:13] <sinzui> Edit > Preferences > Editor
  28 [18:13] <sinzui> * Set the tab width to 4 or 8 spaces per the project you are working on
  29 [18:13] <sinzui> * Insert spaces instead of tabs
  30 [18:13] <sinzui> * Enable automatic indentation
  31 [18:14] <sinzui> Edit > Preferences > Plugins
  32 [18:14] <sinzui> Enable: Bookmarks,
  33 [18:14] <sinzui> Code comment, Draw
  34 [18:14] <sinzui> spaces, File browser,
  35 [18:14] <sinzui> panel, GDP Bazaar
  36 [18:14] <sinzui> integration, GDP Find,
  37 [18:14] <sinzui> GDP Format, GDP
  38 [18:14] <sinzui> Syntax, Completer,
  39 [18:14] <sinzui> Modelines, Snippets,
  40 [18:14] <sinzui> Sort, Spell Checker
  41 [18:14] <sinzui> ^ that is only half of the plugins that are installed. There are others that you may want
  42 [18:15] <sinzui> There are also competing and overlaping plugins. notably Word Completion, Snippets, and GDP Syntax Completer
  43 [18:16] <sinzui> The Draw spaces plugin requires additional configuration to work
  44 [18:16] <sinzui> Use the Preferences
  45 [18:16] <sinzui> button in the Plugins
  46 [18:16] <sinzui> tab to set the kinds
  47 [18:16] <sinzui> of white-space you
  48 [18:16] <sinzui> want to see:
  49 [18:17] <sinzui> Enable/disable the plugin using Menu > View > Show white space
  50 [18:17] <sinzui> GDP Syntax completer plugin
  51 [18:17] <sinzui> Use Alt+/ to view a list of candidates to replace the text being typed:
  52 [18:17] <sinzui> * Python identifiers
  53 [18:17] <sinzui> * Open or used xml tags
  54 [18:17] <sinzui> * Words in the document
  55 [18:18] <sinzui> ^ Alt+/ is not convenient, but it avoids the conflicting accelerator issue upstream
  56 [18:19] <sinzui> GDP find and replace plugin
  57 [18:20] <sinzui> Search multiple files within a directory Filter on sub-directory or file name fragment
  58 [18:20] <sinzui> * Use regular expressions
  59 [18:20] <sinzui> * Match case
  60 [18:20] <sinzui> * Replace in multiple files (supports REs)
  61 [18:20] <sinzui> * Save the list of matches
  62 [18:20] <sinzui> The plugin appears in the right panel.
  63 [18:21] <sinzui> You can show the side panel from using F9, or Menu > View > Side panel
  64 [18:21] <sinzui> The find and replace actions are also in the Search menu
  65 [18:22] <sinzui> GDP formating and syntax/style checking
  66 [18:23] <sinzui> Menu > Tools > Check style and syntax reports errors and issues in one of more files being edited
  67 [18:23] <sinzui> There is special support for Python, Javascript, and CSS
  68 [18:24] <sinzui> where syntax errors are reported
  69 [18:24] <sinzui> There are actions under Menu > Tools to reformat CSS and doctest files
  70 [18:25] <sinzui> Menu > Edit > Format provides
  71 [18:25] <sinzui> * text rewrapping
  72 [18:25] <sinzui> * Fix line ending
  73 [18:25] <sinzui> * tabs to spaces
  74 [18:25] <sinzui> * regular expression inline reformatting
  75 [18:25] <sinzui> GDP Bazaar integration
  76 [18:26] <sinzui> * Branch, edit, commit, and push bazaar projects.
  77 [18:26] <sinzui> * bzr-gtk is used to visualize the files and tree
  78 [18:26] <sinzui> * Work with SVN, HG, and git branches when the proper bzr plugins are installed
  79 [18:28] <sinzui> I also use Source Code Browser pugin: A source code class and function browser based on Exuberant Ctags
  80 [18:28] <sinzui> See https://github.com/Quixotix/gedit-source-code-browser
  81 [18:29] <sinzui> ^ This, like my own gedit-developer-plugins is transitioning to Gedit 3.x plugin architecture
  82 [18:29] <sinzui> Some features of the plugins there are available in natty are not available at this moment in oneiric
  83 [18:31] <sinzui> 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
  84 [18:31] <sinzui> bzr-gtk is being updated the gtk3. We may see a package for testing this week
  85 [18:32]  * sinzui is doing the conversion
  86 [18:33] <sinzui> 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
  87 [18:34] <sinzui> 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.
  88 [18:35] <sinzui> 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
  89 [18:44] <sinzui> bulldog98: there is a vi mode plugin for gedit 2.x
  90 [18:45] <sinzui> mohammedalieng: keyboard shortcuts can be enabled for ALL gtk applications by hacking a gconf/dconf config key
  91 [18:45] <sinzui>  The feature is essentially gtkrc accelerator configs files
  92 [18:46] <sinzui> shazzner: gdp syntax completer will complete python and show the ptyhon help(). It needs refinement
  93 [18:47] <sinzui> 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
  94 [18:49] <sinzui> 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!
  95 [18:49] <sinzui> I think I have answered everyone's question
  96 [18:50] <ClassBot> There are 10 minutes remaining in the current session.
  97 [18:50] <sinzui> bulldog98, gvim (gtk-version) uses gtksourceview2 (the gedit display lib).
  98 [18:51] <sinzui> The core gedit app adds undo, find and replace, and plugin support to the core lib
  99 [18:52] <sinzui> So gvim just marries gedit display rules with vim's editing rules
 100 [18:54] <sinzui> 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.
 101 [18:55] <sinzui> I use GDP Syntax Completer and snippet, so I choose the awkward Alt+/ combination :(

MeetingLogs/appdevweek1109/MakingAppDevelopmentEasyGeditDeveloperPlugins (last edited 2011-09-06 19:09:01 by ABTS-KK-Dynamic-249)