unite-kinds に action を追加する
unite-kinds の action とは、Unite で、候補を選択時に
ここでの挙動は、ユーザ側で簡単に追加する事が出来るらしいのでやってみました。
:read の処理を追加する場合はこんな感じです。
let read = { \ 'is_selectable' : 1, \ } function! read.func(candidates)"{{{ for l:candidate in a:candidates call unite#util#smart_execute_command('read', l:candidate.action__path) endfor endfunction"}}} call unite#custom_action('file', 'read', read) unlet read
これで、:Unite file 等で、read を選択することが出来ます。
unite#kinds#file#define() を呼んで直接追加していますけど Unite 的にこれでいいんでしょうか……。
※修正しました。
しかし、便利っすなー。
[追記]
unite#custom_action({kind}, {name}, {action}) を使用して追加するのが正解らしいです。
そんな訳でコードを修正。
id:thinca さんありがとうございます。