UniteからVimRePressを開き、さらに便利なキーマップとファイルタイプを設定してみた
let g:unite_source_menu_menus.command = {
\ 'description' : 'command',
\ }
let g:unite_source_menu_menus.command.candidates = {
\ 'save' : 'BlogSave',
\ 'pagelist' : 'exe "BlogList page" | exe "nnoremap <buffer> E :BlogOpen <C-R><C-W><CR>" | exe "nnoremap <buffer> q <C-W>q"',
\ 'postlist' : 'exe "BlogList post" | exe "nnoremap <buffer> E :BlogOpen <C-R><C-W><CR>" | exe "nnoremap <buffer> q <C-W>q"',
\ 'page' : 'exe "tabe" | exe "BlogNew page" | exe "inoremap <buffer> <M-n> <Space><Space><CR>" | exe "setf markdown" | exe "nnoremap <buffer> Q :BlogPreview<CR>" | exe "nnoremap <buffer> <Space>w :BlogPreview publish<CR>"',
\ 'post' : 'exe "tabe" | exe "BlogNew post" | exe "inoremap <buffer> <M-n> <Space><Space><CR>" | exe "setf markdown" | exe "nnoremap <buffer> Q :BlogPreview<CR>" | exe "nnoremap <buffer> <Space>w :BlogPreview publish<CR>"',
\ }
function g:unite_source_menu_menus.command.map(key, value)
return {
\ 'word' : a:key, 'kind' : 'command',
\ 'action__command' : a:value,
\ }
endfunction " }}}
nnoremap <silent> <Space>q :<C-u>Unite -vertical -create menu:command<CR>