mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 01:23:43 -05:00
Added vim multi-buffer search, similar to Ctrlp. Fixed capitalization.
30
examples.md
30
examples.md
@@ -165,4 +165,32 @@ function! Arghandler(l)
|
||||
endfunction
|
||||
```
|
||||
|
||||
Then use `:AgFZF` followed by an ag-recogizable regex to pipe ag results into FZF for narrowing. Selected results are opened in new tabs so that you can open multiple positions within the same file (perhaps there's a better way of doing this).
|
||||
Then use `:AgFZF` followed by an ag-recogizable regex to pipe ag results into fzf for narrowing. Selected results are opened in new tabs so that you can open multiple positions within the same file (perhaps there's a better way of doing this).
|
||||
|
||||
search lines in all open vim buffers
|
||||
---
|
||||
|
||||
```vimL
|
||||
command! FZFLines call fzf#run({
|
||||
\'source': BuffersLines(),
|
||||
\'sink' : function('LineHandler'),
|
||||
\})
|
||||
|
||||
function! LineHandler(l)
|
||||
let keys = split(a:l,' ')
|
||||
exec 'buf ' . keys[0]
|
||||
let line = join(keys[4:-1])
|
||||
exec search(escape(line, '\\/.*$^~[]'))
|
||||
endfunction
|
||||
|
||||
function! BuffersLines()
|
||||
let all = range(1, bufnr('$'))
|
||||
let res = []
|
||||
for b in all
|
||||
if buflisted(b)
|
||||
let res = res + map(getbufline(b,0,"$"), 'b . " -- " . (v:key + 1) . " -- " . v:val ')
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endfunction
|
||||
```
|
||||
Reference in New Issue
Block a user