What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)?
I found this will have git ignore temporary files created by vim:
[._]*.s[a-w][a-z] [._]s[a-w][a-z] *.un~ Session.vim .netrwhist *~
It can also be viewed here.