unite-menu
という unite-source を unite.vim 追加してもらいました。
これを使用すると昨日の unite-source はこんな感じになります。
[vimrc]
if !exists("g:unite_source_menu_menus") let g:unite_source_menu_menus = {} endif " menu の説明 let s:commands = { \ 'description' : 'Shortcut', \} " コマンドを登録 let s:commands.candidates = { \ "BoostTest" : "VimFiler $TEST_BOOST", \ "C++Test" : "VimFiler $TEST_CPP", \ "ghci" : "VimShellInteractive ghci", \ "python" : "VimShellInteractive python", \ "Unite Beautiful Attack" : "Unite -auto-preview colorscheme", \ "Boost.MPL Ref" : "OpenBrowser http://www.boost.org/doc/libs/release/libs/mpl/doc/refmanual/refmanual_toc.html", \ "VimShellPop" : "VimShellPop", \} " 上記で登録したコマンドを評価する関数 " 最終的にこれで評価した結果が unite に登録される function s:commands.map(key, value) return { \ 'word' : a:key, \ 'kind' : 'command', \ 'action__command' : a:value, \} endfunction let g:unite_source_menu_menus["shortcut"] = deepcopy(s:commands) unlet s:commands " 呼び出しのキーマップ nnoremap <silent> <Space>ll :Unite menu:shortcut<CR> let s:commands = { \ 'description' : 'Boost Reference', \} let s:commands.candidates = { \ "Lambda" : "OpenBrowser http://www.boost.org/doc/libs/release/doc/html/lambda.html", \ "Phoenix" : "OpenBrowser http://www.boost.org/doc/libs/release/libs/phoenix/doc/html/index.html", \ "Asio" : "OpenBrowser http://www.boost.org/doc/libs/release/doc/html/boost_asio.html", \ "MPL" : "OpenBrowser http://www.boost.org/doc/libs/release/libs/mpl/doc/index.html", \} function s:commands.map(key, value) return { \ 'word' : a:key, \ 'kind' : 'command', \ 'action__command' : a:value, \} endfunction let g:unite_source_menu_menus["boost-ref"] = deepcopy(s:commands) unlet s:commands " 呼び出しのキーマップ nnoremap <silent> <silent> <Space>bb :Unite menu:boost-ref<CR>
unite-menu では、まず最初に登録したメニュー(shortcut と boost-ref)が列挙され、各メニューを選択すると設定したコマンドが列挙されます。
これでかなり使い勝手がよくなったのではないでしょうか。