mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-03-01 12:56:59 +08:00
@@ -56,8 +56,8 @@ Commands
|
|||||||
| `Buffers` | Open buffers |
|
| `Buffers` | Open buffers |
|
||||||
| `Colors` | Color schemes |
|
| `Colors` | Color schemes |
|
||||||
| `Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) |
|
| `Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) |
|
||||||
| `Lines` | Lines in loaded buffers |
|
| `Lines [QUERY]` | Lines in loaded buffers |
|
||||||
| `BLines` | Lines in the current buffer |
|
| `BLines [QUERY]` | Lines in the current buffer |
|
||||||
| `Tags [QUERY]` | Tags in the project (`ctags -R`) |
|
| `Tags [QUERY]` | Tags in the project (`ctags -R`) |
|
||||||
| `BTags [QUERY]` | Tags in the current buffer |
|
| `BTags [QUERY]` | Tags in the current buffer |
|
||||||
| `Marks` | Marks |
|
| `Marks` | Marks |
|
||||||
|
|||||||
@@ -259,11 +259,13 @@ endfunction
|
|||||||
function! fzf#vim#lines(...)
|
function! fzf#vim#lines(...)
|
||||||
let [display_bufnames, lines] = fzf#vim#_lines(1)
|
let [display_bufnames, lines] = fzf#vim#_lines(1)
|
||||||
let nth = display_bufnames ? 3 : 2
|
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({
|
return s:fzf(fzf#vim#wrap({
|
||||||
\ 'source': lines,
|
\ 'source': lines,
|
||||||
\ 'sink*': s:function('s:line_handler'),
|
\ 'sink*': s:function('s:line_handler'),
|
||||||
\ 'options': '+m --tiebreak=index --prompt "Lines> " --ansi --extended --nth='.nth.'.. --reverse --tabstop=1'
|
\ 'options': '+m --tiebreak=index --prompt "Lines> " --ansi --extended --nth='.nth.'.. --reverse --tabstop=1'.s:q(query)
|
||||||
\}), a:000)
|
\}), args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
@@ -289,11 +291,13 @@ function! s:buffer_lines()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#vim#buffer_lines(...)
|
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({
|
return s:fzf(fzf#vim#wrap({
|
||||||
\ 'source': s:buffer_lines(),
|
\ 'source': s:buffer_lines(),
|
||||||
\ 'sink*': s:function('s:buffer_line_handler'),
|
\ 'sink*': s:function('s:buffer_line_handler'),
|
||||||
\ 'options': '+m --tiebreak=index --prompt "BLines> " --ansi --extended --nth=2.. --reverse --tabstop=1'
|
\ 'options': '+m --tiebreak=index --prompt "BLines> " --ansi --extended --nth=2.. --reverse --tabstop=1'.s:q(query)
|
||||||
\}), a:000)
|
\}), args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
@@ -575,7 +579,7 @@ function! s:btags_sink(lines)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:q(query)
|
function! s:q(query)
|
||||||
return ' --query "'.escape(a:query, '"').'"'
|
return ' --query "'.escape(a:query, '"\').'"'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" query, [[tag commands], options]
|
" query, [[tag commands], options]
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ COMMANDS *fzf-vim-commands*
|
|||||||
`Buffers` | Open buffers
|
`Buffers` | Open buffers
|
||||||
`Colors` | Color schemes
|
`Colors` | Color schemes
|
||||||
`Ag [PATTERN]` | {ag}{5} search result (ALT-A to select all, ALT-D to deselect all)
|
`Ag [PATTERN]` | {ag}{5} search result (ALT-A to select all, ALT-D to deselect all)
|
||||||
`Lines` | Lines in loaded buffers
|
`Lines [QUERY]` | Lines in loaded buffers
|
||||||
`BLines` | Lines in the current buffer
|
`BLines [QUERY]` | Lines in the current buffer
|
||||||
`Tags [QUERY]` | Tags in the project ( `ctags -R` )
|
`Tags [QUERY]` | Tags in the project ( `ctags -R` )
|
||||||
`BTags [QUERY]` | Tags in the current buffer
|
`BTags [QUERY]` | Tags in the current buffer
|
||||||
`Marks` | Marks
|
`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=? -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 -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 Buffers call fzf#vim#buffers(s:w(<bang>0))',
|
||||||
\'command! -bang Lines call fzf#vim#lines(s:w(<bang>0))',
|
\'command! -bang -nargs=* Lines call fzf#vim#lines(<q-args>, s:w(<bang>0))',
|
||||||
\'command! -bang BLines call fzf#vim#buffer_lines(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 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=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))',
|
\'command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, s:w(<bang>0))',
|
||||||
|
|||||||
Reference in New Issue
Block a user