Update fzf#complete example

This commit is contained in:
Junegunn Choi 2015-08-22 01:00:25 +09:00
parent 8855227506
commit b26dc157b9

View file

@ -85,15 +85,17 @@ following exceptions:
completion prefix as the argument and return the final value completion prefix as the argument and return the final value
- `sink` or `sink*` are not allowed - `sink` or `sink*` are not allowed
#### Reducer example
```vim ```vim
function! s:first_line_in_uppercase(lines) function! s:make_sentence(lines)
return toupper(a:lines[0]) return substitute(join(a:lines), '^.', '\=toupper(submatch(0))', '').'.'
endfunction endfunction
inoremap <expr> <c-x><c-k> fzf#complete({ inoremap <expr> <c-x><c-s> fzf#complete({
\ 'source': 'cat /usr/share/dict/words', \ 'source': 'cat /usr/share/dict/words',
\ 'reducer': function('<sid>first_line_in_uppercase'), \ 'reducer': function('<sid>make_sentence'),
\ 'options': '--no-multi --reverse --margin 15%,0', \ 'options': '--multi --reverse --margin 15%,0',
\ 'left': 20}) \ 'left': 20})
``` ```