From owner-freebsd-questions Sun Oct 20 18: 6:24 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF39837B401 for ; Sun, 20 Oct 2002 18:06:22 -0700 (PDT) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6139E43E6E for ; Sun, 20 Oct 2002 18:06:20 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-b155.otenet.gr [212.205.244.163]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id g9L169bg009172; Mon, 21 Oct 2002 04:06:12 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.6/8.12.6) with ESMTP id g9L0Mlk7004412; Mon, 21 Oct 2002 03:22:47 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by hades.hell.gr (8.12.6/8.12.6/Submit) id g9L0MjiB004411; Mon, 21 Oct 2002 03:22:46 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 21 Oct 2002 03:22:44 +0300 From: Giorgos Keramidas To: Jon Nathan Cc: freebsd-questions@freebsd.org Subject: Re: fmt(1) inside vi Message-ID: <20021021002243.GB3652@hades.hell.gr> References: <20021020234954.GM79229@froody.rupture.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021020234954.GM79229@froody.rupture.net> X-PGP-Fingerprint: C1EB 0653 DB8B A557 3829 00F9 D60F 941A 3186 03B6 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-10-20 19:49, Jon Nathan wrote: > I'm trying to create a macro to justify a paragraph in vi. Something > similar to ctrl-j in pico. I found fmt(1). In its manpage, it says > that !}fmt will justify a paragraph. I can't get this to work > though. This is my .exrc: > > :map v ^i# ^[j0 > :set wm=10 > :map E !}fmt > :map F !Gfmt > > So, E should justify the current paragraph. F is supposed to justify > from the cursor position until the end of the file. They both work in > that they justify the text, but they add this: > > stty: stdin isn't a terminal > > in the file. This is usually an indication of a common abuse of the shell startup files. You have used biff(1) or mesg(1) in a startup file that is run by non-interactive sessions of your shell. Normally, users of csh(1) should avoid using biff(1) or mesg(1) in their .cshrc files, or when they do use these commands in .cshrc (which is used both by login and non-login csh instances), they should attempt to protect the non-interactive invocations of the shell from running these two commands by wrapping them in if-endif blocks: if ($?prompt) then biff n mesg y endif Note the difference between the following two csh subshells: keramida@hades[03:17]/tmp$ touch empty keramida@hades[03:17]/tmp$ csh -c tty /dev/ttyp2 keramida@hades[03:17]/tmp$ csh -c tty < empty not a tty > How can I make this work in vi (notwithstanding that vim is a > workaround)? By removing the offending commands from .cshrc (or the equivalent startup file, for your shell), or properly checking that you are running on a tty before attempting to use them. Giorgos. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message