From owner-freebsd-questions Sun Oct 20 16:50: 8 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 689F437B401 for ; Sun, 20 Oct 2002 16:50:06 -0700 (PDT) Received: from froody.rupture.net (froody.rupture.net [63.236.108.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id D684743E97 for ; Sun, 20 Oct 2002 16:50:05 -0700 (PDT) (envelope-from jon@rupture.net) Received: from froody.rupture.net (localhost [127.0.0.1]) by froody.rupture.net (8.12.5/8.12.5) with ESMTP id g9KNnsA2096874 for ; Sun, 20 Oct 2002 19:49:55 -0400 (EDT) (envelope-from jon@rupture.net) Date: Sun, 20 Oct 2002 19:49:54 -0400 To: freebsd-questions@freebsd.org Subject: fmt(1) inside vi Message-ID: <20021020234954.GM79229@froody.rupture.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i From: Jon Nathan X-Delivery-Agent: TMDA/0.62 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 Hi, 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. For what it's worth, these commands work and don't complain about stdin not being a terminal in vim (from ports). When I hit E or F from vi, the bottom line shows: !fmt When I hit E or F from vim, the bottom line shows: :.,$!fmt How can I make this work in vi (notwithstanding that vim is a workaround)? Some more details: jon@froody:~> uname -a FreeBSD froody.rupture.net 4.6-STABLE FreeBSD 4.6-STABLE #5: Thu Aug 1 12:28:45 EDT 2002 jon@n3.chaffee.com:/usr/obj/usr/src/sys/FROODY i386 jon@froody:~> pkg_info | grep vim vim-6.1.206 Vi "workalike", with many additional features jon@froody:~> echo $TERM vt100 jon@froody:~> -jon -- Jon Nathan jon@rupture.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message