Thursday, September 15, 2011

Re: now swap file when loading file below a certain directory?

On 2011-09-16, mcc wrote:
> Hi,
>
> can I instruct vim not to create a swap file, when the original
> file is below a certain directory???

":help 'swapfile'" says, "This option can be reset when a swapfile
is not wanted for a specific buffer." So, something like this in
your ~/.vimrc should work. (Untested)

au BufNewFile,BufRead /path/to/directory/* setlocal noswapfile

That will handle files _in_ a certain directory. I think changing
the pattern to /path/to/directory/** will handle files in that
directory and below.

Regards,
Gary

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