Tuesday, February 1, 2011

Re: Help, please

On Tue, 1 Feb 2011, Tim Chase wrote:

>> I apologize for being ornery. I have had to deal with Windows and
>> AT&T lately. I will do better.
>
> Heh, either Windows or AT&T alone is enough to boil one's blood, so I
> can sympathize and appreciate the occasional bad day. :)
>
>> I'm aware of most of the options in vim. I'm not aware of any option
>> to put the swapfiles elsewhere. That would also work.
>
> Vim does provide the 'directory' option
>
> :help 'directory'
>
> which can be used to put the swapfile in the first directory in the
> listing. For warnings, read below
>
> :help E326
>
> on the advantages/disadvantages to changing this. The only times I've
> used this was back when floppy-drives were the norm, and having a
> swapfile on a floppy was agonizingly slow.

Personally, I find the first listed advantage to be the best:
- You will not pollute the directories with ".swp" files.

To avoid the first listed disadvantage...
- You can get name collisions from files with the same name but in
different directories[...]

...I use a 'directory' setting ending in two directory separators:

set dir=~/.vim-tmp//

Then, as described at :help 'dir', I get swap files with directories
"embedded" with percent signs in place of directory separators, e.g.:

~/.vim-tmp/%home%bhaskell%tmp%compile%saved-test-1277816925.swp

This would keep swap files out of your Dropbox directory (in addition to
the other benefits). The only drawback is the second disadvantage
listed in :help E326, that another person editing the same file won't
see your swap file if it's in your home directory. (But you have that
problem anyway if the other user doesn't use Vim, for example.)

--
Best,
Ben

--
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

No comments: