From b26dc157b9f039b8f510e4da9cc4a4c225c60d7f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 22 Aug 2015 01:00:25 +0900 Subject: [PATCH] Update fzf#complete example --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4d1c14d..4dfc4f0 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,17 @@ following exceptions: completion prefix as the argument and return the final value - `sink` or `sink*` are not allowed +#### Reducer example + ```vim -function! s:first_line_in_uppercase(lines) - return toupper(a:lines[0]) +function! s:make_sentence(lines) + return substitute(join(a:lines), '^.', '\=toupper(submatch(0))', '').'.' endfunction -inoremap fzf#complete({ +inoremap fzf#complete({ \ 'source': 'cat /usr/share/dict/words', - \ 'reducer': function('first_line_in_uppercase'), - \ 'options': '--no-multi --reverse --margin 15%,0', + \ 'reducer': function('make_sentence'), + \ 'options': '--multi --reverse --margin 15%,0', \ 'left': 20}) ```