Vim Advent Calendar 2013 183日目: unite-neobundle から github の Issues を開く

この記事は Vim Advent Calendar 2013 183日目の記事になります。
今回は軽めの記事。
さて、プラグインを使っていると稀によくバグを見つけることがあります。
そんな時にさっとプラグインの Issues を開きたいですよね。
と、いうことで unite-neobundle に任意のプラグインgithub の Issues を開くアクションを追加してみました。

[ソース]

let s:action = {
\   'description' : 'open github issues',
\   'is_selectable' : 1,
\}

function! s:action.func(candidates)
    for candidate in a:candidates
        if candidate.action__bundle.type ==# "git"
            call OpenBrowser(candidate.action__uri . "/issues")
        else
            echohl Error | echo "Not github uri." | echohl NONE
        endif
    endfor
endfunction

call unite#custom#action('source/neobundle/uri', 'open_issues', s:action)
unlet s:action

[使い方]

:Unite neobundle を開いてアクションから "open_issues" を選択します。
また、ブラウザで開くために open-browser.vim が必要になります。
ちなみに "start" アクションでそのプラグインリポジトリのページを開くこともできます。
"start" アクションの方は neobundle.vim の標準機能として実装されています。
便利。