diff -cr vim70.orig/src/getchar.c vim70/src/getchar.c *** vim70.orig/src/getchar.c 2006-09-12 21:47:30.000000000 -0400 --- vim70/src/getchar.c 2006-09-12 21:53:35.000000000 -0400 *************** *** 1495,1500 **** --- 1495,1507 ---- int vgetc() { + static time_t last_call = 0; + static int cps = 0; + char_u sPaste[] = "paste"; + time_t now; + if (p_apa) + now = time(NULL); + int c, c2; #ifdef FEAT_MBYTE int n; *************** *** 1502,1507 **** --- 1509,1527 ---- int i; #endif + if (p_apa && !p_paste) { + if (last_call == now) + ++cps; + else + cps = 0; + if (cps >= 30) { + cps = 0; + do_set(&sPaste, 0); + showmode(); + } + last_call = now; + } + /* * If a character was put back with vungetc, it was already processed. * Return it directly. --- vim72/src/optiondefs.h~ 2009-05-18 22:23:40.000000000 +0300 +++ vim72/src/optiondefs.h 2009-05-18 22:30:25.277259155 +0300 @@ -377,6 +377,9 @@ {"autoindent", "ai", P_BOOL|P_VI_DEF, (char_u *)&p_ai, PV_AI, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, + {"autopaste", "apa", P_BOOL|P_VI_DEF, + (char_u *)&p_apa, PV_NONE, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"autoprint", "ap", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, --- vim72/src/option.h~ 2009-05-18 22:23:40.000000000 +0300 +++ vim72/src/option.h 2009-05-18 22:30:25.277259155 +0300 @@ -312,6 +312,7 @@ #if defined(FEAT_GUI) && defined(MACOS_X) EXTERN int *p_antialias; // 'antialias' #endif +EXTERN int p_apa; /* 'autopaste' */ EXTERN int p_ar; // 'autoread' EXTERN int p_aw; // 'autowrite' EXTERN int p_awa; // 'autowriteall'