[GitFiles] Take ls-files options as the arguments

Close #146
This commit is contained in:
Junegunn Choi 2016-05-25 00:24:12 +09:00
parent c786d51637
commit 4d911563cd
No known key found for this signature in database
GPG key ID: 254BC280FEF9C627
3 changed files with 28 additions and 28 deletions

View file

@ -48,31 +48,31 @@ Plug 'junegunn/fzf.vim'
Commands
--------
| Command | List |
| --- | --- |
| `Files [PATH]` | Files (similar to `:FZF`) |
| `GitFiles` | Git files (git ls-files) |
| `GitFiles?` | Git files (git status) |
| `Buffers` | Open buffers |
| `Colors` | Color schemes |
| `Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) |
| `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 |
| `Windows` | Windows |
| `Locate PATTERN` | `locate` command output |
| `History` | `v:oldfiles` and open buffers |
| `History:` | Command history |
| `History/` | Search history |
| `Snippets` | Snippets ([UltiSnips][us]) |
| `Commits` | Git commits (requires [fugitive.vim][f]) |
| `BCommits` | Git commits for the current buffer |
| `Commands` | Commands |
| `Maps` | Normal mode mappings |
| `Helptags` | Help tags <sup id="a1">[1](#helptags)</sup> |
| `Filetypes` | File types
| Command | List |
| --- | --- |
| `Files [PATH]` | Files (similar to `:FZF`) |
| `GitFiles [OPTS]` | Git files (git ls-files) |
| `GitFiles?` | Git files (git status) |
| `Buffers` | Open buffers |
| `Colors` | Color schemes |
| `Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) |
| `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 |
| `Windows` | Windows |
| `Locate PATTERN` | `locate` command output |
| `History` | `v:oldfiles` and open buffers |
| `History:` | Command history |
| `History/` | Search history |
| `Snippets` | Snippets ([UltiSnips][us]) |
| `Commits` | Git commits (requires [fugitive.vim][f]) |
| `BCommits` | Git commits for the current buffer |
| `Commands` | Commands |
| `Maps` | Normal mode mappings |
| `Helptags` | Help tags <sup id="a1">[1](#helptags)</sup> |
| `Filetypes` | File types
- Most commands support `CTRL-T` / `CTRL-X` / `CTRL-V` key
bindings to open in a new tab, a new split, or in a new vertical split

View file

@ -409,9 +409,9 @@ function! fzf#vim#gitfiles(args, ...)
if v:shell_error
return s:warn('Not in git repo')
endif
if a:args !~ '^?'
if a:args != '?'
return s:fzf(fzf#vim#wrap({
\ 'source': 'git ls-files',
\ 'source': 'git ls-files '.a:args,
\ 'dir': root,
\ 'options': '-m --prompt "GitFiles> "'
\}), a:000)

View file

@ -75,7 +75,7 @@ COMMANDS *fzf-vim-commands*
Command | List ~
-----------------+-------------------------------------------------------------------
`Files[PATH]` | Files (similar to `:FZF` )
`GitFiles` | Git files (git ls-files)
`GitFiles [OPTS]` | Git files (git ls-files)
`GitFiles?` | Git files (git status)
`Buffers` | Open buffers
`Colors` | Color schemes