panozzaj / vim-copilot-ignore

Vim plugin to disable Copilot based on .copilotignore
MIT License
6 stars 1 forks source link

respect local ignore file irrespective of current work dir #4

Open Konfekt opened 5 hours ago

Konfekt commented 5 hours ago

The plug-in currently only cares about a repo-local ignore file if Vim's current work dir is that of the repo. Would it not make sense to respect it as soon as the file is inside a folder containing such an ignore file?

panozzaj commented 5 hours ago

Open to this change, I have seen this in some other projects as well (nvm, etc.) Are you thinking it would be the first .copilotignore it finds, or it would add them up along the way?

Konfekt commented 5 hours ago

I'd stick with a first and the global one. Note that your suggestion would practically dispense with the latter

panozzaj commented 4 hours ago

I thought git ignore looked at the global ~/.gitignore as well as the first match, but it seems like that's something I had configured in my ~/.gitconfig (see https://stackoverflow.com/questions/7335420/global-git-ignore).

So I think finding the first one is reasonable, or finding the first one and the global.

Konfekt commented 3 hours ago

Maybe https://github.com/tpope/vim-fugitive/blob/d4877e54cef67f5af4f950935b1ade19ed6b7370/plugin/fugitive.vim#L308 serves as inspiration how to implement such a folder recursion