On 9/13/06, Ian Kilgore <[EMAIL PROTECTED]> wrote:
Pasting code into vim and forgetting to set paste can have annoying
results.  This patch detects the 'really fast typing' that happens when
something is pasted in, and turns on paste mode.  It provides an option
'autopaste' (default false) which controls the behavior.

Patch is attached.  Hope this is useful.

Nice. So simple. I have couple of comments.

1. Don't you need to reset 'paste' back to 'nopaste' when
high cps stops ?

2. It would be better if cps be settable, not hardcoded to 30.
Maybe value of 'autopaste' can be made the cps boundary
'set autopaste=30', value 0 disables ?

3. Regarding line do_set(&sPaste, 0); I think typical vim style
is to write do_set("paste", 0); then
                char_u sPaste[] = "paste";
                do_set(&sPaste, 0);

Yakov


Yakov

Reply via email to