From 3a21001a485ba635311f64682f52a177a52a8d83 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 9 Aug 2015 22:45:21 +0900 Subject: [PATCH] Remove fuzzy commandline example (#316) --- Examples-(vim).md | 54 +---------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/Examples-(vim).md b/Examples-(vim).md index e385157..dc91292 100644 --- a/Examples-(vim).md +++ b/Examples-(vim).md @@ -216,56 +216,4 @@ command! -nargs=* Ag call fzf#run({ \ '--color hl:68,hl+:110', \ 'down': '50%' \ }) -``` - -### Fuzzy cmdline completion - -```vimL -cnoremap eGetCompletions() -"add an extra at the end of this line to automatically accept the fzf-selected completions. - -function! Lister() - call extend(g:FZF_Cmd_Completion_Pre_List,split(getcmdline(),'\(\\\zs\)\@\eLister()\\" - let l:FZF_Cmd_Completion_List = g:FZF_Cmd_Completion_Pre_List[len(l:Prefix):-1] - unlet g:FZF_Cmd_Completion_Pre_List - if len(l:Prefix) > 0 && l:Prefix[0] =~ - \ '^ed\=i\=t\=$\|^spl\=i\=t\=$\|^tabed\=i\=t\=$\|^arged\=i\=t\=$\|^vsp\=l\=i\=t\=$' - "single-argument file commands - return CmdLineDirComplete(l:Prefix, "",l:cmdline_list[-1]) - elseif len(l:Prefix) > 0 && l:Prefix[0] =~ - \ '^arg\=s\=$\|^ne\=x\=t\=$\|^sne\=x\=t\=$\|^argad\=d\=$' - "multi-argument file commands - return CmdLineDirComplete(l:Prefix, '--multi', l:cmdline_list[-1]) - else - return join(l:Prefix + fzf#run({ - \'source':l:FZF_Cmd_Completion_List, - \'options': '--select-1 --query='.shellescape(l:cmdline_list[-1]) - \})) - endif -endfunction -``` - -hit `` while in the ex commandline (i.e. after pressing `:`) to have fzf filter a list of vim's commandline auto-completions. Try `:colo␣` (be sure to include the space) or `:b␣`. There are special cases for handling file-searches, so that you can go deeper into the path than just one directory at a time, and so that you can add multiple files to the arglist at once. More special cases could be added. Some limitations: the auto-complete for `:help` and `:tag` are limited to 300 entries, so you may need to narrow it a bit. +``` \ No newline at end of file