git ignore vim temporary files

后端 未结 12 936
刺人心
刺人心 2020-12-12 08:38

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)?

12条回答
  •  萌比男神i
    2020-12-12 09:15

    If You are using source control. vim temp files are quite useless.
    So You might want to configure vim not to create them.

    Just edit Your ~/.vimrc and add these lines:

    set nobackup
    set noswapfile
    

提交回复
热议问题