junegunn / junegunn/fzf.vim

Change default `git ls-files` command to include new files

Open
#1,423 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
10.3k
Forks
608
Avg merge
5d 8h
Merged PRs (30d)
2

Description

- [x] I have fzf 0.30.0 or above
- [x] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md
- [x] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md
- [x] I have read through the manual page of fzf (`man fzf`)
- [x] I have searched through the existing issues

When I search for `GFiles` it works really well. But when I add new files then they don't show up. Initially I thought that this is a caching issue but when I tried to run `ls-files` myself then I didn't see the new files.

```
# default command:
[_@_ _]$ git ls-files | wc -l
265
# this should be equivalent to the "no arg" command
[_@_ _]$ git ls-files --exclude-standard --cached | wc -l
265
# I propose to use this instead of the default:
[_@_ _]$ git ls-files --others --exclude-standard --cached | wc -l
266
```

So while `git ls-files` does the job it could also include the new files that I still want to work with. They're included in the `GFiles?` but why not have this command instead of the standard `GFiles`?
This is the command that could work with all files (I'll add it for myself but it could probably be a good default function too):

```
git ls-files --others --exclude-standard --cached
```
Or maybe you could simply add it to the suggested config defaults like this:
```
:GFiles --others --exclude-standard --cached
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.