GVIM on windows: way to disable the tmp file creation

前端 未结 5 2149
悲哀的现实
悲哀的现实 2021-02-01 02:47

I use gvim on windows and I want to know a way to disable the temp file(ending in ~) file creation. Also is there a problem if we do it?

5条回答
  •  攒了一身酷
    2021-02-01 03:18

    It's not quite what you asked for, but something that I've found works well is to redirect the swap and backup files to a seperate, dedicated folder. That way, they're still there if I need them, but they're not cluttering up the folder I'm working in.

    The _vimrc file can be created in any of the following locations:

    • %HOMEPATH%\_vimrc
    • C:\Program Files (x86)\Vim\_vimrc

    The following lines in the _vimrc file put backup files into a temporary directory:

    set backup
    set dir=%TMP%
    set backupdir=%TMP%
    set directory=%TMP%
    set noundofile
    

    The last line prevents the proliferation of undo files.

提交回复
热议问题