Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 2002 19:49:54 -0400
From:      Jon Nathan <jon+dated+1035762594.214939@rupture.net>
To:        freebsd-questions@freebsd.org
Subject:   fmt(1) inside vi
Message-ID:  <20021020234954.GM79229@froody.rupture.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021020234954.GM79229>