Questions tagged [original-vi]
Questions that are specific to the original vi written by Bill Joy in the '70's for 1BSD, which was open sourced in 2002. It is sometimes also called "traditional vi" or "2BSD vi".
32 questions
7
votes
1
answer
888
views
vi (an old AIX vi, not vim): map: I can search, move, yank, or dd, but cannot paste
On regular AIX vi (not vim, just plain old vi):
I tried to do the following map, but it fails on the "P" or "p" part with the message Cannot use the put command while inside a ...
1
vote
2
answers
64
views
Command to add a blank line after each 30 rows in vim
I have 51*249 rows in a data file and I want to add a blank space after every 249 rows in Vi editor. I tried to find such commands but failed to get one. Please help me with this one.
0
votes
1
answer
67
views
Automate Enumeration in vi
Note, this question is about vi, not vim or any other clone. I work on AIX (IBMs UNIX) and the (to my knowledge standard-conforming) vi editor.
Quite often I need to enumerate a list of values, like ...
0
votes
1
answer
47
views
Removing a line that ends with a " : " with vi (on AIX)
Very simply, I need to remove lines in a file that end with a :.
I've tried many things but have not managed it. I cannot even find the right search pattern.
example line:
anbdskjhd:
I would like to ...
0
votes
2
answers
81
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!");
...
0
votes
1
answer
78
views
vi Specification
I am looking to polish up Open Watcom's Text Editor's vi mode (it's open source), but I don't have expert experience with vi. Is there a de facto standard or formal specification for how vi's ...
1
vote
1
answer
83
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)....
1
vote
0
answers
195
views
vi cursor not working properly when line numbers are set
The cursor with !set nu works as !set nonu. Cursor starts on frist character in margin space before the line numbers start instead of first character after line numbers. Cursor on line end will stop ...
0
votes
1
answer
2k
views
Searching a log file using vi or view
When I open a log file in vi or view and I need to search for a word, the first thing I do is to press G to get to the bottom. Then I'll start a search using a / followed by whatever word I'm looking ...
1
vote
1
answer
98
views
Why does vi sometimes use harder-to-reach keys?
For example:
[[ and ]] instead of [ and ], and
G instead of g.
Some ideas:
Vim used these keys first, and they were backported to Vi (though G seems like an essential command for a code editor)
Vi ...
1
vote
1
answer
1k
views
How to clear a vim register (vi/ex buffer)?
In the ex linage of editors, one can append to a register(vim)/buffer(ex,vi) by specifying the register name in uppercase. As an example
g/pat/y A
will append every line match pat to register a. But ...
6
votes
1
answer
230
views
How to disable mouse scroll wheel when in normal mode?
I want to completely disable the mouse but mouse scrolling in normal mode is not disabled. I have disabled other mouse function but scrolling in normal mode is still on.
To disable the mouse I have ...
1
vote
2
answers
268
views
why wont vi recognize html?
I recently launched a RHEL instance on an EC2 container.
I got the apache web server to launch, now I'm trying to write some html in /var/www/html to get my website going. I open index.html in vi , ...
2
votes
1
answer
354
views
How to remap escape in *vi* (not vim)?
I've used the information in this answer previously, but recently encountered a minimal installation with only vi. I edited the .vimrc in the user's home folder (~/.vimrc), but when typing jj, the ...
0
votes
1
answer
596
views
what is the difference between calling vim by typing vi and typing vim
I know this must seem stupid... however I've just wasted like 2 hours trying to get vim-plug working. I am on CentOS7. I type vi and it brings up vim 7.4.160. I typed vim and I get vim: command not ...
3
votes
1
answer
430
views
What are the compatibility differences between the two modelines?
:h modeline says the following:
There are two forms of modelines. The first form:
[text]{white}{vi:|vim:|ex:}[white]{options}
(...)
vi:noai:sw=3 ts=6 ~
vim: tw=77 ~
The second form (...
3
votes
1
answer
182
views
Original vi (version 1.1): Copy lines to alternate file without using named buffer
To copy a line to the alternate file in original vi I use something like
"ayy
:e#
"aP
The first vi version did have the alternate file feature (with switch command :e`) but did not have named ...
3
votes
2
answers
124
views
How to search for a pattern that starts at newline in ex/vi
How do I search for pattern that is not at the beginning of a line?
Ex:
Name1 Name2 Name3 Name4 Name5 Name6
Something like:
/[^^]Name.
Obviously the second ^ symbol does not mean beginning of ...
4
votes
1
answer
2k
views
How do I map a key to search for a pattern and replace it with newline in ex/vi?
I am trying to map q in vi (not Vim) to find a pattern and replace it with newline:
Name1 Name2 Name3 Name4
to
Name1
Name2
Name3
Name4
When I try ([Ctrl-V] and [Enter] are actual keystrokes)
:map ...
9
votes
2
answers
647
views
Use ex-command to check whether two lines are identical?
I was looking at this
question and then
wondered how I might implement my answer which uses
sed using purely
POSIX
ex.
The trick is that while in sed I can compare the hold space with
the pattern ...
9
votes
1
answer
5k
views
How can I replace a word with a yanked word in Vi?
Lately I've found myself working more and more with remote servers over SSH. Most of those severs don't have Vim, but just Vi. Using it hasn't been too rough with just a few problems.
One is this:
...
43
votes
2
answers
10k
views
Why is Y a synonym for yy instead of y$?
Is there a specific historical reason for this?
Background — (you can skip this part if you already understand the question.)
As intermediate/advanced vi users will know, y is the "yank" command—it ...
7
votes
2
answers
464
views
Why is ] used for tag navigation?
Several of the commands for browsing programs with tags use ].
Is there a mnemonic for this?
Why was it selected?
71
votes
2
answers
61k
views
What are the differences between :wq<cr> :x<cr> and ZZ when exiting vim?
Vi and Vim, as all of you know, have many synonyms. There are three ways I know of to save the file and exit Vim and Vi. These are :wq <cr>, :x <cr> and ZZ. I have heard that these are ...
33
votes
5
answers
26k
views
Biggest differences between Vim and vi
Today, I decided to try vi instead of Vim; I wanted to see how different it is.
I didn't notice much differences at all. The biggest thing I noticed was how vi didn't say -- INSERT -- when I went ...
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 (|)@, ...
4
votes
2
answers
2k
views
What are differences between POSIX vi and minimal vi implementations, if any?
I have a few questions about vi and its current relationship with Vim. First of all, is Vim minimal (i.e. the default vi on Cygwin) basically a POSIX compliant implementation of vi? I believe POSIX ...
17
votes
3
answers
7k
views
Fix arrow keys displaying A, B, C, D in vi (not in vim)
I know that in vim I can add
set nocompatible
in .vimrc to avoid that arrow keys display A, B, C, D in insert mode.
But I'm using vi Version 4.0 (gritter) 12/25/06.
How can I obtain the same ...
10
votes
1
answer
462
views
What is the origin of the term "yank"?
I'm interested in learning how the term yank got its name. I'm also interested in why Vi/Vim "yank" differs from Emacs "yank".
See also: same question on Unix & Linux; dual question about Emacs
1
vote
0
answers
83
views
What is "open mode" and why is it in Vi but not in Vim? [duplicate]
From the Vim documentation:
1. Simulated command *simulated-command*
This command is in Vi, but Vim only simulates it:
*:o* *:op* *:...
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 ...
24
votes
2
answers
7k
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,...