camspiers / snap

A fast finder system for neovim.
The Unlicense
483 stars 16 forks source link

Include untracked files in git files #48

Closed beauwilliams closed 3 years ago

beauwilliams commented 3 years ago

Putting this here in case anyone else is interested in this too

YodaEmbedding commented 3 years ago

Similarly, also show untracked hidden files that are not .gitignore'd. (This should also apply to producer.fd.file.)

beauwilliams commented 3 years ago

That should be doable. I might see if I have time later to improve my PR.

fd.file, shouldnt that show files regardless of git?

beauwilliams commented 3 years ago

Similarly, also show untracked hidden files that are not .gitignore'd. (This should also apply to producer.fd.file.)

This should be fixed in my branch. We can see here hidden and untracked files are showing.

There is no option with git ls-files to not show hidden files. They display by default and you can not hide them afaik.

image

yujinyuz commented 3 years ago

I think this is a similar issue #62

You can now include untracked files in git by passing extra arguments to git file. I have this in my config

snap.maps {
  {
    '<leader><leader>', file {
      try = {
        snap.get('producer.git.file').args({'--cached', '--others', '--exclude-standard'}),
        'ripgrep.file',
      },
      prompt = 'Files',
    },
  },
}
beauwilliams commented 3 years ago

Perfect 😃 Thanks for the heads up