I was wondering if there is a way to get vim to read .gitignore files and use them to determine options not to present when auto-completing filenames.
For example, work
Vim will ignore file patterns specified in option wildignore , so you can set them like so:
:set wildignore=*.o,*~,*.pyc
Or place the same line (without the ":") in your ~/.vimrc file. If you need something more dynamic like adjusting to the .gitignore in the current directory then you'll need to do some scripting, but I'll leave that as an exercise for someone else.