Discussion:
(n)vi
(too old to reply)
c***@yahoo.com
2022-05-03 04:23:50 UTC
Permalink
slackware 15.0 has changed to nvi and now it behaves like FreeBSD's vi: In
insert mode when you move to the first of a line it switches to command
mode. I'd rather it didn't but it hasn't worried me enough to look into
how to change it. But I have wondered why.

--Ron
Ben Collver
2022-05-03 14:32:32 UTC
Permalink
Post by c***@yahoo.com
slackware 15.0 has changed to nvi and now it behaves like FreeBSD's vi: In
insert mode when you move to the first of a line it switches to command
mode. I'd rather it didn't but it hasn't worried me enough to look into
how to change it. But I have wondered why.
--Ron
I don't know why, but i suspect it has something to do with gaining
support for UTF-8 [1]. It was an install-time option for me whether i
wanted Slackware 15.0 to use elvis, nvi, or vim. When i run
"ls -l /usr/bin/vi" it shows up as a symbolic link. If you want to
change back to elvis, you could do the following as root.

# cd /usr/bin
# ln -fs elvis vi

[1]
https://github.com/mbert/elvis/issues/13
Ron
2022-05-03 20:34:50 UTC
Permalink
Post by Ben Collver
Post by c***@yahoo.com
slackware 15.0 has changed to nvi and now it behaves like FreeBSD's vi: In
insert mode when you move to the first of a line it switches to command
mode. I'd rather it didn't but it hasn't worried me enough to look into
how to change it. But I have wondered why.
--Ron
I don't know why, but i suspect it has something to do with gaining
support for UTF-8 [1]. It was an install-time option for me whether i
wanted Slackware 15.0 to use elvis, nvi, or vim. When i run
"ls -l /usr/bin/vi" it shows up as a symbolic link. If you want to
change back to elvis, you could do the following as root.
# cd /usr/bin
# ln -fs elvis vi
[1]
https://github.com/mbert/elvis/issues/13
Sorry, I knew that wasn't well written. I was wondering why it switches to
command mode when you move to the 1st of a line. (Though it certainly
doesn't hurt to know the reason for the shift to nvi!)

--Ron
John McCue
2022-05-03 21:14:12 UTC
Permalink
<snip>
Post by Ron
Sorry, I knew that wasn't well written. I was wondering why
it switches to command mode when you move to the 1st of a
line. (Though it certainly doesn't hurt to know the reason for
the shift to nvi!)
I was unaware of the functionality you asked about, but yes it
happens to me also.

So I checked at work on our AIX box, and on the "real" vi
(Version 3.10) it works the same exact way. So I am fairly
sure that is why we see that happening in nvi.
Post by Ron
--Ron
John
--
[t]csh(1) - "An elegant shell, for a more... civilized age."
- Paraphrasing Star Wars
Poprocks
2022-05-03 21:03:42 UTC
Permalink
Post by c***@yahoo.com
slackware 15.0 has changed to nvi and now it behaves like FreeBSD's vi: In
insert mode when you move to the first of a line it switches to command
mode. I'd rather it didn't but it hasn't worried me enough to look into
how to change it. But I have wondered why.
I'm guessing you're using the 'Home' button to return to the beginning
of the line? On my machines, if I hit Home while in insert mode on nvi,
it inserts a junk character, and *then* goes into normal mode. So then
when you hit Home again, it does return to the beginning of the line,
albeit in normal mode.

So if that's what you're doing, I'm thinking this has more to do with
using the Home button to return to the beginning of the line than
specific behaviour in nvi.

I only really use vim, but in standard vi editors, you return to the
beginning of the line by typing '0' in normal mode. So that is how I've
trained myself to do it for years, and the muscle memory is just not
going to change. So I don't really personally have much motivation to
get this working with the Home button. So I'm thinking this likely has
to do with keymappings, etc., and some of the usual gross stuff that can
cause Backspace not to work as expected.
Loading...