Saturday, December 17, 2011

Re: GVim Win32 on Win7 suddenly very slow to load

Hi KF!

On Fr, 16 Dez 2011, KF wrote:

> Details:
> I have an autocmd to strip white spaces from end of line when writing
> to disk, which was taken from Vim wiki:
>
> autocmd FileType c,cpp,java,php,txt autocmd BufWritePre <buffer> :call
> setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))

That is absolute unnecessary and let's Vims memory consumption rise
dramatically. I can't think of why one would want such an autocommand.
Apart from the memory issue and that it is hard to read, it is a lot
simpler to use :%s/\s\+$//

> Anybody can check and verify this behaviour?

Yes. Simply don't use that autocommand.

regards,
Christian
--
Nun, wo fließt Petersburg hin? Petersburg fließt in die Ostsee.
-- Johann Georg August Galletti

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

Post a Comment