m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-20 17:43:42 -05:00

Added vim multi-buffer search, similar to Ctrlp. Fixed capitalization.

gleachkr
2014-07-04 02:14:36 -07:00
parent 96becc7f64
commit 25b3902a34

@@ -165,4 +165,32 @@ function! Arghandler(l)
endfunction 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
```