How to prevent vim from creating (and leaving) temporary files?

前端 未结 7 2013
时光取名叫无心
时光取名叫无心 2020-11-28 01:09

Why does vim create ~ files? Is there a way to disable that?

If it\'s for backup (or something), I use git for that.

Also, thes

7条回答
  •  鱼传尺愫
    2020-11-28 01:41

    I'd strongly recommend to keep working with swap files (in case Vim crashes).

    You can set the directory where the swap files are stored, so they don't clutter your normal directories:

    set swapfile
    set dir=~/tmp
    

    See also

    :help swap-file
    

提交回复
热议问题