Add GitFiles command
This commit is contained in:
parent
0e995e1913
commit
1a2d597045
4 changed files with 15 additions and 0 deletions
|
@ -49,6 +49,7 @@ Commands
|
||||||
| Command | List |
|
| Command | List |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `Files [PATH]` | Files (similar to `:FZF`) |
|
| `Files [PATH]` | Files (similar to `:FZF`) |
|
||||||
|
| `GitFiles` | Git files
|
||||||
| `Buffers` | Open buffers |
|
| `Buffers` | Open buffers |
|
||||||
| `Colors` | Color schemes |
|
| `Colors` | Color schemes |
|
||||||
| `Ag [PATTERN]` | [ag][ag] search result (`CTRL-A` to select all, `CTRL-D` to deselect all) |
|
| `Ag [PATTERN]` | [ag][ag] search result (`CTRL-A` to select all, `CTRL-D` to deselect all) |
|
||||||
|
|
|
@ -323,6 +323,18 @@ function! fzf#vim#history(...)
|
||||||
\}, a:000)
|
\}, a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" ------------------------------------------------------------------
|
||||||
|
" GitFiles
|
||||||
|
" ------------------------------------------------------------------
|
||||||
|
|
||||||
|
function! fzf#vim#gitfiles(...)
|
||||||
|
call s:fzf({
|
||||||
|
\ 'source': 'git ls-tree --name-only -r HEAD',
|
||||||
|
\ 'sink*': s:function('s:common_sink'),
|
||||||
|
\ 'options': '--prompt "GitFiles> " -m'.s:expect(),
|
||||||
|
\}, a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
" Buffers
|
" Buffers
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
|
|
|
@ -75,6 +75,7 @@ COMMANDS *fzf-vim-commands*
|
||||||
Command | List ~
|
Command | List ~
|
||||||
-----------------+---------------------------------------------------------------------
|
-----------------+---------------------------------------------------------------------
|
||||||
`Files [PATH]` | Files (similar to `:FZF` )
|
`Files [PATH]` | Files (similar to `:FZF` )
|
||||||
|
`GitFiles` | Git files
|
||||||
`Buffers` | Open buffers
|
`Buffers` | Open buffers
|
||||||
`Colors` | Color schemes
|
`Colors` | Color schemes
|
||||||
`Ag [PATTERN]` | {ag}{5} search result (CTRL-A to select all, CTRL-D to deselect all)
|
`Ag [PATTERN]` | {ag}{5} search result (CTRL-A to select all, CTRL-D to deselect all)
|
||||||
|
|
|
@ -43,6 +43,7 @@ endfunction
|
||||||
|
|
||||||
call s:defs([
|
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 GitFiles call fzf#vim#gitfiles(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 Lines call fzf#vim#lines(s:w(<bang>0))',
|
||||||
\'command! -bang BLines call fzf#vim#buffer_lines(s:w(<bang>0))',
|
\'command! -bang BLines call fzf#vim#buffer_lines(s:w(<bang>0))',
|
||||||
|
|
Loading…
Add table
Reference in a new issue