As I have been tired to have to navigate to the issues query page on either OOo IssueZilla or Novell Bugzilla when I have a comment like #iXXXX#, I wrote a small Vim function to do it for me. Here is the script I have added to my .vimrc.
" Open IssueZilla / Bugzilla for the selected issue
function! OpenIssue( )
let s:browser = "firefox"
let s:wordUnderCursor = expand("")
let s:urlTemplate = ""
let s:pattern = "\\(\\a\\+\\)\\(\\d\\+\\)"
let s:prefix = substitute( s:wordUnderCursor, s:pattern, "\\1", "" )
let s:id = substitute( s:wordUnderCursor, s:pattern, "\\2", "" )
if s:prefix == "i"
let s:urlTemplate = "http://qa.openoffice.org/issues/show_bug.cgi?id=%"
elseif s:prefix == "n"
let s:urlTemplate = "https://bugzilla.novell.com/show_bug.cgi?id=%"
endif
if s:urlTemplate != ""
let s:url = substitute( s:urlTemplate, "%", s:id, "g" )
let s:cmd = "silent !" . s:browser . " " . s:url . "&"
execute s:cmd
endif
endfunction
map :call OpenIssue()
To run the script, place the cursor on a word in the form iXXXXX or nXXXXX and hit Ctrl-i. you will certainly need to tweak to script if you which to add other shortcuts or use another browser. Of course, this is not cross-platform and could be much more configurable. If you have some improvements in this area, please propose them! Many thanks to this Vim tip which helped me a lot to write this script.