Can’t enter insert mode in Vi editor

25,265

Solution 1

Try the a key for the same -- INSERT -- operation. It should work just like i. AFAIK, it works on Ubuntu 12.04 and Raspbian.

Solution 2

Install Vim as it is an improved version of vi.

sudo apt-get install vim

To open a file with vim, you have to use vim command insteat of vi

vim abc.txt

Solution 3

first of all install this command in your ubuntu prompt :

sudo apt-get install vim

then after work the insert mode.

Share:
25,265

Related videos on Youtube

Xentius
Author by

Xentius

Updated on September 18, 2022

Comments

  • Xentius
    Xentius over 1 year

    I am using the Vi editor on my desktop Ubuntu 12.04, and do no have any problems. But a few days ago, I installed the Vi editor to my beagleboard-xm which has both Angstrom and Ubuntu 12.04 available but noticed that I cannot activate the insert mode at both of the Op. Systems. How I understood that:

    When I press i or I, I do not get a warning on the bottom, just -- INSERT --. But if I continue and if I press k, the cursor moves to the line above, and if I press j, the cursor moves to the line below. If I try to put a # to comment out something, the cursor moves randomly and according to warning written at the bottom: "search hit TOP, continuing at BOTTOM", etc. etc.

    How can I get into insert mode? Any suggestions?

    • devav2
      devav2 over 11 years
      open vi and try to set :set showmode. Then try "Esc - i(insert mode)"
    • Xentius
      Xentius over 11 years
      @devav2 I tried what you suggested, first at the bottom -- INSERT -- warning has written but when I pressed the arrow keys that warning disappeared and same behavior continues.
  • MadMike
    MadMike over 10 years
    Even though your answer will work, it would be nice to know, why you suggest to install it.
  • bioinformatician
    bioinformatician over 10 years
    Just because, vim is an improved version, Simple.
  • MadMike
    MadMike over 10 years
    I know. I meant it as a suggestion on how to improve your answer. Please, hit the edit link on your answer and add the information there.
  • Martin Thornton
    Martin Thornton over 8 years
    Please edit your answer to explain what this does, and why you believe it to be a solution.
  • Iluvathar
    Iluvathar over 7 years
    It's not "just like [i]" — [a] starts insertion after current character, while [i] inserts before current character.