Questions tagged [nvi]

A free and "bug-compatible" clone of Bill Joy's original `vi`. It first appeared in 4.4BSD.

Filter by
Sorted by
Tagged with
0 votes
2 answers
69 views

Why is the cursor not visually positioned on the first column when it is on the first column of an indented line?

I inserted the program below in both the original vi and nvi. The indented lines are indented using a single tab. #include <stdio.h> int main(void) { puts("Hello world!"); ...
Flux's user avatar
  • 1,021
1 vote
5 answers
798 views

In nvi, how do I undo "already locked, session is read-only?"

On Mac OS Big Sur (11.6.3) with nvi 1.81.6 and several tmux panels, I accidentally quit Terminal. Now opening files leads to the message <file> already locked, session is read-only <file> ...
turtleyacht's user avatar
0 votes
0 answers
56 views

nvi: how to define a new command to write using sudo

In Vim, I can define the following command for writing a file using sudo: command! W :execute ':silent w !sudo tee % > /dev/null' | :edit! How do I define a similar command in nvi for saving using ...
Flux's user avatar
  • 1,021
1 vote
1 answer
80 views

What is the correct cursor position when a } (forward paragraph motion) reaches the last line of the buffer?

Suppose I have two lines in a buffer: First line Second line I position my cursor on the first column of the first line. In normal mode, I press } (i.e. closing curly brace, forward paragraph motion)....
Flux's user avatar
  • 1,021
2 votes
1 answer
206 views

Is there an autosave option for vi/nvi

My version is the following: :ve Version nvi-1.81.6nb5 (2009-08-11) The CSRG, University of California, Berkeley. Is it possible to save a file at regular intervals in vi/nvi? I know there is an "...
Ottavio Caruso's user avatar
0 votes
2 answers
193 views

vi/nvi (FreeBSD) How to make an abbreviation to a shell command?

I know how to make an abbreviation to a command in vim. For example to print the date, I have this in .vimrc: iabbrev mydate <C-R>=strftime("%a %d/%m/%Y") Now I'm running a VM with FreeBSD as ...
Ottavio Caruso's user avatar
3 votes
1 answer
182 views

Is it possible to read a shell command's output from nvi's command line?

I was trying see if I can integrate fzf with nvi, but couldn't find a way to do something like :Edit <shell command's output> which would solve my problem. I tried :source nvi.ex -- it works ...
Nishant's user avatar
  • 207
1 vote
0 answers
174 views

`nvi` use contents of register in ex command

I'd like to be able to get the contents of a register in nvi, such as using b"wye to yank a word into the w register and then invoke a shell command with the current word in it. Currently, I have ...
Greg Nisbet's user avatar
  • 1,839
2 votes
0 answers
242 views

:q will not let me exit vim [closed]

When using nvi I have a file that I want to exit but everytime I use :q it just opens this thing and I can't exit out of it. Does anyone know what it is and how to get rid of it? Note: this is nvi ...
smmr's user avatar
  • 21
1 vote
0 answers
110 views

Vim to behave like nvi when opening line in empty buffer

I want to Vim to behave like nvi when opening a in an empty buffer. This is an empty buffer: ---------------------------------------- ~ ~ ~ ~ ---------------------------------------- After typing ...
wefwefa3's user avatar
  • 1,163
2 votes
1 answer
1k views

Position cursor at end of line in insert mode

(This question pertains to nvi instead of vim.) To facilitate editing, I created the following mappings map! ( (?)@^[F?xi map! [ [?]@^[F?xi map! { {?}@^[F?xi so that entering ( will insert (|)@, ...
Kevin's user avatar
  • 220
3 votes
1 answer
626 views

specifying a recovery file in nvi

I have an nvi session that got interrupted, and I'd like to recover my edits. When I type vi -r, it tells me "no files to recover." But there is a recovery file in /var/tmp/vi.recover, and when I ...
Targeloid's user avatar
  • 133
2 votes
1 answer
155 views

I get the error "./en_US.UTF-8: No such file or directory" when starting nvi

I'm using nvi on Mac OS X 10.10.3, installed from MacPorts. Whenever I start the editor, the following message is displayed in my console: ./en_US.UTF-8: No such file or directory I'm just curious ...
Kusalananda's user avatar
15 votes
3 answers
10k views

Can I undo multiple times in nvi and/or the original vi?

Sometimes I'm on a system without Vim, and use the default nvi (BSD systems) or the original vi (Arch Linux). There are quite a few differences, but the largest annoyance is that I can undo only my ...
Martin Tournoij's user avatar
24 votes
2 answers
6k views

What is the relation between vi, nvi and vim?

On some unixes sometime I found a command named nvi. It was a vi-like editor, without much of its functionality. Maybe it was a fork of the old vi? Anyways, which vi versions are a fork of the others,...
peterh's user avatar
  • 1,147