mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-01-19 17:42:58 +08:00
[fzf#vim#buffers] Allow users to pass a custom list of buffer numbers
Introducing a global configuration variable may seem easier but this
method is more flexible in that it allows you to define multiple
variations of the command without having to repeatedly setting and
unsetting the variable.
function! MyBuffers()
return filter(range(1, bufnr('$')), 'buflisted(v:val) && getbufvar(v:val, "&filetype") != "qf"')
endfunction
command! -bar -bang Buffers call fzf#vim#buffers(MyBuffers(), fzf#vim#with_preview({'placeholder': '{1}'}), <bang>0)
Close #831
Close #393
This commit is contained in:
20
README.md
20
README.md
@@ -217,16 +217,16 @@ endfunction
|
||||
Each command in fzf.vim is backed by a Vim function. You can override
|
||||
a command or define a variation of it by calling its corresponding function.
|
||||
|
||||
| Command | Vim function |
|
||||
| --- | --- |
|
||||
| `Files` | `fzf#vim#files(dir, [spec dict], [fullscreen bool])` |
|
||||
| `GFiles` | `fzf#vim#gitfiles(git_options, [spec dict], [fullscreen bool])` |
|
||||
| `GFiles?` | `fzf#vim#gitfiles('?', [spec dict], [fullscreen bool])` |
|
||||
| `Buffers` | `fzf#vim#buffers([spec dict], [fullscreen bool])` |
|
||||
| `Colors` | `fzf#vim#colors([spec dict], [fullscreen bool])` |
|
||||
| `Rg` | `fzf#vim#grep(command, [spec dict], [fullscreen bool])` |
|
||||
| `RG` | `fzf#vim#grep2(command_prefix, query, [spec dict], [fullscreen bool])` |
|
||||
| ... | ... |
|
||||
| Command | Vim function |
|
||||
| --- | --- |
|
||||
| `Files` | `fzf#vim#files(dir, [spec dict], [fullscreen bool])` |
|
||||
| `GFiles` | `fzf#vim#gitfiles(git_options, [spec dict], [fullscreen bool])` |
|
||||
| `GFiles?` | `fzf#vim#gitfiles('?', [spec dict], [fullscreen bool])` |
|
||||
| `Buffers` | `fzf#vim#buffers([query string], [bufnrs list], [spec dict], [fullscreen bool])` |
|
||||
| `Colors` | `fzf#vim#colors([spec dict], [fullscreen bool])` |
|
||||
| `Rg` | `fzf#vim#grep(command, [spec dict], [fullscreen bool])` |
|
||||
| `RG` | `fzf#vim#grep2(command_prefix, query, [spec dict], [fullscreen bool])` |
|
||||
| ... | ... |
|
||||
|
||||
(We can see that the last two optional arguments of each function are
|
||||
identical. They are directly passed to `fzf#wrap` function. If you haven't
|
||||
|
||||
Reference in New Issue
Block a user