Subject: Re: is vi(1)'s autoindent the right default behaviour?
To: Igor Sobrado <igor@string1.ciencias.uniovi.es>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-userlevel
Date: 06/03/2005 15:38:34
--ibTvN161/egqYuK8
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.
|=20
| :-)))
|=20
| "set ai" and "set noai" require typing few characters!
|=20
| ":r! cat /dev/tty"... 16 characters (+changing to "command mode") and
| two additional characters for ^D. "set ai" + "set noai"... 6+8 charact=
ers
| and changing to command mode two times!
|=20
| 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".
Cheers,
Luke.
--ibTvN161/egqYuK8
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)
iD8DBQFCn+zapBhtmn8zJHIRArZBAKCCZo8usssEW1Xh3j4mcW9iIMAx1wCfRr1s
6pFrVoOZQ6xwTqJcEnj6svE=
=Sh2F
-----END PGP SIGNATURE-----
--ibTvN161/egqYuK8--