Disable VIM to create swap file (.swn, .swo, .swp)

2,103 views
Skip to first unread message

Jimmy

unread,
Jul 15, 2008, 11:47:22 AM7/15/08
to vim_use
Is there a way to disable it? I like to keep files open with VIM all
the time and having the text content retain in memory, rather than the
swap file.

Thanks,
Jimmy

sc

unread,
Jul 15, 2008, 12:30:23 PM7/15/08
to vim...@googlegroups.com

perhaps what you are looking for is

:set noswapfile

for your .vimrc

sc


Tim Chase

unread,
Jul 15, 2008, 12:31:28 PM7/15/08
to vim...@googlegroups.com
> Is there a way to disable it? I like to keep files open with
> VIM all the time and having the text content retain in memory,
> rather than the swap file.

You'll want to read at

:help 'swapfile'

where you'll read that you should be able to use

:set noswapfile

along with caveats about large files and recovery. The only
reason I'd consider not using a swap-file is if the information
being edited was confidential, and I didn't want any trace of it
touching the disk improperly/unexpectedly. If it's because of
performance issues, you may prefer to put the swap file someplace
else, which can be controlled via the 'directory' option:

:help 'directory'

so if you're writing to a slow device (such as a floppy), you can
put your swapfile on a faster drive.

-tim


Reply all
Reply to author
Forward
0 new messages