Subject: Re: is vi(1)'s autoindent the right default behaviour?
To: Igor Sobrado <>
From: Luke Mewburn <>
List: tech-userlevel
Date: 06/03/2005 15:38:34
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 09, 2005 at 10:14:27AM +0200, Igor Sobrado wrote:
  | Hi Greg and Luke!
  | > I find it quicker to do:
  | >=20
  | > 	:r! cat /dev/tty
  | > 	[paste here]
  | > 	^D
  | >=20
  | > than to toggle ai (autoindent) off & on.
  | :-)))
  | "set ai" and "set noai" require typing few characters!
  | ":r! cat /dev/tty"... 16 characters (+changing to "command mode") and
  | two additional characters for ^D.  "set ai" + "set noai"... 6+8 charact=
  | and changing to command mode two times!
  | It *cannot* be quicker!

Actually, it can, and it's also "safer" to use the ":r! cat /dev/tty".
Consider if you have:

    *	showmatch enabled and you paste text with brackets in it.
	On a slow(er) terminal, vi will bounce the cursor around the screen.

    *	wrapmargin enabled and you paste text that's too long; it will
	be automatically wrapped.

    *	you have abbreviations defined and you paste text with those
	abbreviations in it; the abbreviations will be expanded.

(Note: I have a key macros to toggle settings such as 'wm', 'list', 'number=
'ai', etc)

I.e, I use ":r! /cat/dev/tty" to perform the operation of
"insert this chunk of text literally, with no translations".


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.1 (NetBSD)