Questions tagged [vi]

Vi is a screen-oriented text editor originally created for the Unix operating system.

Vi is a screen-oriented text editor originally created for the Unix operating system.

vi is a modal editor: it operates in either insert mode (where typed text becomes part of the document) or normal mode (where keystrokes are interpreted as commands that control the edit session). For example, typing i while in normal mode switches the editor to insert mode, but typing i again at this point places an "i" character in the document. From insert mode, pressing the escape switches the editor back to normal mode. A perceived advantage of vi's separation of text entry and command modes is that both text editing and command operations can be performed without requiring the removal of the user's hands from the home row. As non-modal editors usually have to reserve all keys with letters and symbols for the printing of characters, any special commands for actions other than adding text to the buffer must be assigned to keys which do not produce characters, such as function keys, or combinations of modifier keys such as Ctrl, and Alt with regular keys. Vi has the advantage that most ordinary keys are connected to some kind of command for positioning, altering text, searching and so forth, either singly or in key combinations. Many commands can be touch typed without the use of Shift,Ctrl or Alt. Other types of editors generally require the user to move their hands from the home row when touch typing:

  • To use a mouse to select text, commands, or menu items in a GUI editor.
  • To the arrow keys or editing functions (Home / End or Function Keys).
  • To invoke commands using modifier keys in conjunction with the standard typewriter keys.

For instance, replacing a word is cwreplacement textEscape which is a combination of two independent commands (change and word-motion) together with a transition into and out of insert mode. Text between the cursor position and the end of the word is overwritten by the replacement text. The operation can be repeated at some other location by typing ., the effect being that the word starting that location will be replaced with the same replacement text.

Source: wikipedia

38 questions
0
votes
1 answer

Always hung on Vi, vim, but not nano when using company VPN

I have a strange problem. IT changed the VPN to a newer Cisco device. After connecting to the VPN, I can ssh to one of our corporate server. I can ls, cd, cat, sudo. BUT if I tried any editing using vi or vim My terminal is just blank/black - seem…
RonPringadi
  • 153
  • 1
  • 6
0
votes
1 answer

vi: write relative range of lines to a file

I need to be able to write a range of lines from a file to another file, I've found the :,w solution but what I need is to be able to search for a string and write a a few lines to another file starting at the "found"…
0
votes
2 answers

Return/edit "slash" search string in vi(m)

I've tried searching the web but the phrases are too general or I didn't know what to search for. If I use /(some IP address) in vi I know I can simply enter / (Enter) again and find the next occurrence. What I'm wanting to do is retrieve the…
-1
votes
1 answer

Why does nvi think I have files being editing?

I've got a couple of FreeBSD servers that throw several copies of the following error on reboot: On Wed Oct 10 15:13:16 2012, the user root was editing a file named /tmp/crontab.s00huOAZD2 on the machine server, when it was saved for recovery. You…
Brian Knoblauch
  • 2,188
  • 2
  • 32
  • 45
-1
votes
1 answer

is it possible to know whether someone else has opened file in ec2-linux

We guys work collaboratively. Sometimes more then 1 have opened same file in vi editor. Can I know there who else has opened that file in amazon ec2 instance? Also if I can know what changes made by other ..
-2
votes
1 answer

Unable to set a cron job in Centos

I recently got an VPS to experiment, I have installed Centos and is trying to see if I can setup hostbill and run it from there. The installation all worked out well but I am stumped when it comes to setting up a cron job. I need to setup the…
Rick Roy
  • 215
  • 1
  • 5
  • 15
-2
votes
1 answer

Vi how to search for numbers

I want to search for the occurrence of 100169200 I typed /100169200 but vi says Pattern not found Edit Since the question has been downvotes, I would like to make it clear that grep can find the number in the file, but vi does not. Edit 2 For the…
Rosdi
  • 229
  • 2
  • 3
  • 11
-3
votes
1 answer

editing files on remote server with Vi not recognised when I refresh my browser

My server is running on Apache Linux. I'm very new to this area. Is there a default folder where the website files are stored? I mean I thought I had it - the first one in the list below, but it doesn't seem to be. I've been editing what I thought…
CHarris
  • 101
  • 2
1 2
3