Monday, November 24, 2014

Re: When *~ and .*.swp will be written ?

On Saturday, November 22, 2014 1:09:01 AM UTC-6, meino....@gmx.de wrote:
> Hi,
>
> I am running vim (also) on a Gentoo Linux on this little thing of
> board:
> http://www.acmesystems.it/arietta
>
> Since there is no harddisc but only a sdcard -- and flash memeory has
> a limited amount of write cycles -- I want to eliminated unneccary
> writes to the sdcard.
>
> One source of unessary writes are -- in some cases -- the backup-
> and swap-files vim generates.
>
> When will these types of file be open while starting vim?
>
> Or in other words:
> Is it early enough to do a :set noswapfile | set nobackup right
> after loading an existing file (which is more then 0 bytes long)
> to prevent creating of any additional file?
>
> Thank you very much in advance for any help!
> Best regards,
> mcc

Backup files are only written when writing a file, so wherever you set that option is fine as long as you do it before writing the file.

Swap files are written as soon as you open a file. You'll need to either use the new :noswapfile command modifier, or turn off swap files globally in your .vimrc. Your .vimrc gets executed prior to loading any files so that will be early enough.

Undo files are like backup files, they only write when you save the file or explicitly tell Vim to write one.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: