mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 17:43:42 -05:00
escaping spaces in filenames, adding multiple files to the arglist
15
examples.md
15
examples.md
@@ -228,9 +228,16 @@ function! GetCompletions()
|
|||||||
\ (l:Prefix[0] == 'vs') ||
|
\ (l:Prefix[0] == 'vs') ||
|
||||||
\ (l:Prefix[0] == 'sp')
|
\ (l:Prefix[0] == 'sp')
|
||||||
\)
|
\)
|
||||||
return join(l:Prefix + fzf#run({
|
return join(l:Prefix + map(fzf#run({'options': '--select-1 --query='.l:cmdline_list[-1] }),
|
||||||
\'options': '--select-1 --query='.l:cmdline_list[-1]
|
\'escape(v:val, " ")'))
|
||||||
\}))
|
elseif len(l:Prefix) > 0 && (
|
||||||
|
\ (l:Prefix[0] == 'ar') ||
|
||||||
|
\ (l:Prefix[0] == 'n') ||
|
||||||
|
\ (l:Prefix[0] == 'sn') ||
|
||||||
|
\ (l:Prefix[0] == 'arga')
|
||||||
|
\)
|
||||||
|
return join(l:Prefix + map(fzf#run({'options': '-m --select-1 --query='.l:cmdline_list[-1] }),
|
||||||
|
\'escape(v:val, " ")'))
|
||||||
else
|
else
|
||||||
return join(l:Prefix + fzf#run({
|
return join(l:Prefix + fzf#run({
|
||||||
\'source':l:FZF_Cmd_Completion_List,
|
\'source':l:FZF_Cmd_Completion_List,
|
||||||
@@ -240,4 +247,4 @@ function! GetCompletions()
|
|||||||
endfunction
|
endfunction
|
||||||
```
|
```
|
||||||
|
|
||||||
hit `<c-l>` while in the ex commandline (i.e. after pressing `:`) to have fzf filter a list of vim's commandline auto-completions. Try `:colo␣<c-l>` (be sure to include the space) or `:b␣<c-l>`. There are special cases for handling file-searches, so that you can go deeper into the directory than just one layer. 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.
|
hit `<c-l>` while in the ex commandline (i.e. after pressing `:`) to have fzf filter a list of vim's commandline auto-completions. Try `:colo␣<c-l>` (be sure to include the space) or `:b␣<c-l>`. There are special cases for handling file-searches, so that you can go deeper into the directory than just one layer, 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.
|
||||||
Reference in New Issue
Block a user