Automatic completion for Closes: entry in Vim

DebConf is always cool: it's the place where 2 minute chats with people can turn into cool hacks.

It just happened to me: 2 minutes with Dancer and Gismo chatting about apt-listbugs and kaboom: in the next upload of Vim you will get for free (as in the free drinks Sun offered us a couple of days ago) completion of Closes: entry in your debian/changelog.

Just start typing Closes: # and after the # execute CTRL-X CTRL-O (the key to invoke "omni completion", see ":help omni-completion" in the Vim online help). At that point apt-listbugs will be invoked by Vim, it will contact the BTS using the SOAP interface to retrieve outstanding bugs, and will offer you a list of bugs to choose from. A brief description of the bug report will be shown as well in a preview window (see ":help preview"). Once you've made your choice, the appropriate "#XXXX" entry will be input where your cursor was. Super-cool!

Here are a couple of screenshot to wet your appetite: screenshot-1.png, screenshot-2.png. If you can't wait for the next Vim upload take my current debchangelog.vim and put it in /usr/share/vim/vimcurrent/ftplugin/.