On Mon, Oct 26, 2026 at 06:33:38AM -0600, Dave Polaschek wrote:
> That did it, thanks. Now I just need to tweak various scripts and
> aliases to use $VISUAL instead of /usr/bin/vi, which I probably
> should’ve done long ago, anyhow. Seems there’s always another yak that
> needs shaving.
> 
> Note that I had no luck just setting the print option in the stock
> /usr/bin/vi, which reports that it's version 1.79 (10/23/96) The CSRG,
> University of California, Berkeley.
> 
> -DaveP


I'm sorry, you should change all the VISUAL references to EDITOR
in my ksh exemple startup code.  VISUAL is an extra complexity level
that is no longer important today. (Because very few people still
use teletype terminals or set TERM to dumb/unknown.)

> 
> On Mon, Oct 26, 2026, at 00:03, Hugo Villeneuve-Lapointe wrote:
> > On Sun, Oct 25, 2026 at 08:02:59PM -0600, Dave Polaschek wrote:
> >> I’ve got a machine running OpenBSD 8.0 with all the patches (as
> >> of a few minutes ago).
[...]
> >> Is there some setting I need to tweak to get vi to display UTF-8
> >> characters correctly, or am I just running into a limitation of vi
> >> here? I don’t need anything more than ASCII most of the time, but
> >> it would be nice to be able to make sure I’ve typed the correct
> >> unichar without having to ^z out and cat the file to be sure.
> >> 
> >
> > vi in OpenBSD does not support UTF-8 yet.
> >
> > You'll have to install an alternate vi from the ports. Either nvi
> > or vim will work.
> >
> > Personnaly, I like nvi+iconv. My ksh's .profile startup script has
> > this in it:
> >
> > LANG=en_US.UTF-8
> > if [ -f /usr/local/bin/nvi ]; then
> >     VISUAL=/usr/local/bin/nvi 
> >     alias ex=/usr/local/bin/nex
> >     alias vi=/usr/local/bin/nvi
> >     alias view=/usr/local/bin/nview
> > else
> >     VISUAL=/usr/bin/vi
> > fi
> > export VISUAL LANG
> > set -o emacs
> >
> >
> > Note that for nvi, weird thing happens if you edit a file that is
> > not UTF-8 but has high 8bit characters. You might have to run 
> > "LANG=C nvi file" to edit it. (nvi+iconv has also a
> > fileencoding/inputencoding settings.)
> >
> > Also, without a LANG set to a UTF-8 encoding, nvi will work like
> > the built-in OpenBSD's vi. (Showing \xc3\xa9 instead of é.)
> >
> > Good luck
> 

Reply via email to