[Geany-devel] [PATCH] Some editor/snippets/keybindings enhancements

Eugene Arshinov earshinov at xxxxx
Sat Jul 10 17:48:35 UTC 2010

Hi all.

I attach three patches:
1. Keybindings to insert new line after/before current
2. Snippet keybindings support
3. Automatically insert additional indentation in XML/HTML files if
previous line ends with an opening tag

They must be unrelated and can be applied independently of each other.

Some of the patches have drawbacks.  Before "polishing" them, I want to
know whether they are useful and may go to trunk.

The drawback of the first patch is that I doubt it's so useful.  I know
Vi[m] provides shortcuts for these actions ('o' and 'O' in normal
mode), but their necessity is questionable for me.  I implemented this
to ease XML editing with tag autocompletion turned on.  Suppose you
need to write to consequent <li>'s.  Without this patch you need to
press End+Enter after writing the first <li> to place the cursor where
you need to start the second.  With my patch, you only need to press
one shortcut you can assign in Preferences > Keybindings :)

The drawback of the third patch is that it's not completed.  If user
likes to leave HTML tags like <br> "unclosed", she would be disturbed by
automatic indentation caused by my patch, so a check box in Preferences
is desirable.  I'll code it as soon as we decide this patch can go to

Speaking about the second patch, here is an example of assigning a
keybinding (I currently use it in my user snippets.conf):

  # special group to define keybindings
  # keybindings' format resembles the one used in Preferences >
  #   Keybindings tab

Keybindings may be assigned either in user or global snippets.conf (I'm
not sure if the latter is useful).  Another decision I made is to allow
keybindings for snippets in [Special] section (like "block_cursor" used
above).  While "block_cursor" snippet is not very useful when you have
to type its name, it is useful when you just have to press a shortcut.

And, as usual for me, all of these patches lack user documentation…

Best regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geany.19.newline_keybindings.r5065.patch
Type: text/x-patch
Size: 6175 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100710/dd8cbd17/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geany.20.snippet_keybindings.r5065.patch
Type: text/x-patch
Size: 7690 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100710/dd8cbd17/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geany.21.xml_autoindent.r5065.patch
Type: text/x-patch
Size: 2075 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100710/dd8cbd17/attachment-0002.bin>

More information about the Devel mailing list