git ignore vim temporary files

后端 未结 12 960
刺人心
刺人心 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条回答
  •  情书的邮戳
    2020-12-12 09:18

    Alternatively you can configure vim to save the swapfiles to a separate location, e.g. by adding lines similar to the following to your .vimrc file:

    set backupdir=$TEMP//
    set directory=$TEMP//
    

    See this vim tip for more info.

提交回复
热议问题