Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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".

0
votes
2answers
49 views

substitution in every other line

how do I search/substitute in every other line. :s/pattern1/pattern2{2}/g file looks like 1 pattern1 text 2 pattern1 text 3 pattern1 text 4 pattern1 text Output file should look like 1 pattern1 ...
0
votes
1answer
81 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 ...
1
vote
1answer
75 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
1answer
138 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 ...
4
votes
2answers
67 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 ...
3
votes
1answer
192 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
2answers
202 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 ...
5
votes
1answer
196 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: ...
26
votes
2answers
765 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 ...
6
votes
2answers
221 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?
29
votes
2answers
13k 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 ...
18
votes
4answers
5k 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 into ...
1
vote
1answer
585 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 (|)@, ...
3
votes
2answers
629 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 ...
16
votes
1answer
1k 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 ...
9
votes
1answer
284 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
0answers
44 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* *:...
11
votes
3answers
4k 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 ...
15
votes
2answers
2k 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,...