parent
47806da408
commit
78c3d254ae
4 changed files with 15 additions and 11 deletions
|
@ -56,8 +56,8 @@ Commands
|
|||
| `Buffers` | Open buffers |
|
||||
| `Colors` | Color schemes |
|
||||
| `Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) |
|
||||
| `Lines` | Lines in loaded buffers |
|
||||
| `BLines` | Lines in the current buffer |
|
||||
| `Lines [QUERY]` | Lines in loaded buffers |
|
||||
| `BLines [QUERY]` | Lines in the current buffer |
|
||||
| `Tags [QUERY]` | Tags in the project (`ctags -R`) |
|
||||
| `BTags [QUERY]` | Tags in the current buffer |
|
||||
| `Marks` | Marks |
|
||||
|
|
|
@ -259,11 +259,13 @@ endfunction
|
|||
function! fzf#vim#lines(...)
|
||||
let [display_bufnames, lines] = fzf#vim#_lines(1)
|
||||
let nth = display_bufnames ? 3 : 2
|
||||
let [query, args] = (a:0 && type(a:1) == type('')) ?
|
||||
\ [a:1, a:000[1:]] : ['', a:000]
|
||||
return s:fzf(fzf#vim#wrap({
|
||||
\ 'source': lines,
|
||||
\ 'sink*': s:function('s:line_handler'),
|
||||
\ 'options': '+m --tiebreak=index --prompt "Lines> " --ansi --extended --nth='.nth.'.. --reverse --tabstop=1'
|
||||
\}), a:000)
|
||||
\ 'options': '+m --tiebreak=index --prompt "Lines> " --ansi --extended --nth='.nth.'.. --reverse --tabstop=1'.s:q(query)
|
||||
\}), args)
|
||||
endfunction
|
||||
|
||||
" ------------------------------------------------------------------
|
||||
|
@ -289,11 +291,13 @@ function! s:buffer_lines()
|
|||
endfunction
|
||||
|
||||
function! fzf#vim#buffer_lines(...)
|
||||
let [query, args] = (a:0 && type(a:1) == type('')) ?
|
||||
\ [a:1, a:000[1:]] : ['', a:000]
|
||||
return s:fzf(fzf#vim#wrap({
|
||||
\ 'source': s:buffer_lines(),
|
||||
\ 'sink*': s:function('s:buffer_line_handler'),
|
||||
\ 'options': '+m --tiebreak=index --prompt "BLines> " --ansi --extended --nth=2.. --reverse --tabstop=1'
|
||||
\}), a:000)
|
||||
\ 'options': '+m --tiebreak=index --prompt "BLines> " --ansi --extended --nth=2.. --reverse --tabstop=1'.s:q(query)
|
||||
\}), args)
|
||||
endfunction
|
||||
|
||||
" ------------------------------------------------------------------
|
||||
|
@ -575,7 +579,7 @@ function! s:btags_sink(lines)
|
|||
endfunction
|
||||
|
||||
function! s:q(query)
|
||||
return ' --query "'.escape(a:query, '"').'"'
|
||||
return ' --query "'.escape(a:query, '"\').'"'
|
||||
endfunction
|
||||
|
||||
" query, [[tag commands], options]
|
||||
|
|
|
@ -80,8 +80,8 @@ COMMANDS *fzf-vim-commands*
|
|||
`Buffers` | Open buffers
|
||||
`Colors` | Color schemes
|
||||
`Ag [PATTERN]` | {ag}{5} search result (ALT-A to select all, ALT-D to deselect all)
|
||||
`Lines` | Lines in loaded buffers
|
||||
`BLines` | Lines in the current buffer
|
||||
`Lines [QUERY]` | Lines in loaded buffers
|
||||
`BLines [QUERY]` | Lines in the current buffer
|
||||
`Tags [QUERY]` | Tags in the project ( `ctags -R` )
|
||||
`BTags [QUERY]` | Tags in the current buffer
|
||||
`Marks` | Marks
|
||||
|
|
|
@ -45,8 +45,8 @@ call s:defs([
|
|||
\'command! -bang -nargs=? -complete=dir Files call fzf#vim#files(<q-args>, s:w(<bang>0))',
|
||||
\'command! -bang -nargs=? GitFiles call fzf#vim#gitfiles(<q-args>, s:w(<bang>0))',
|
||||
\'command! -bang Buffers call fzf#vim#buffers(s:w(<bang>0))',
|
||||
\'command! -bang Lines call fzf#vim#lines(s:w(<bang>0))',
|
||||
\'command! -bang BLines call fzf#vim#buffer_lines(s:w(<bang>0))',
|
||||
\'command! -bang -nargs=* Lines call fzf#vim#lines(<q-args>, s:w(<bang>0))',
|
||||
\'command! -bang -nargs=* BLines call fzf#vim#buffer_lines(<q-args>, s:w(<bang>0))',
|
||||
\'command! -bang Colors call fzf#vim#colors(s:w(<bang>0))',
|
||||
\'command! -bang -nargs=1 -complete=dir Locate call fzf#vim#locate(<q-args>, s:w(<bang>0))',
|
||||
\'command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, s:w(<bang>0))',
|
||||
|
|
Loading…
Add table
Reference in a new issue