Skip to content

Instantly share code, notes, and snippets.

@h1mesuke
Created March 13, 2011 01:28
Show Gist options
  • Save h1mesuke/867775 to your computer and use it in GitHub Desktop.
Save h1mesuke/867775 to your computer and use it in GitHub Desktop.
Vim - Sample of custom filter for unite.vim
let s:converter = {
\ 'name' : 'converter_file_mru',
\ 'description' : 'file_mru converter',
\ }
function! s:converter.filter(candidates, context)
let candidates = copy(a:candidates)
for cand in candidates
let cand.abbr = substitute(cand.abbr, '^([^)]*)', '', '')
endfor
return candidates
endfunction
call unite#define_filter(s:converter)
unlet s:converter
call unite#custom_filters('file_mru', ['matcher_glob', 'converter_file_mru'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment