0

I was using nano before.

I'm a bit confused on how to start inserting text, sometimes I just start typing and on the bottom I see -- insert -- and I can edit and save fine. But sometimes I just skip around without being able to go in edit mode, what is going on?

1
  • 4
    Hint: Install Vim and run vimtutor. May 9, 2012 at 19:51

3 Answers 3

2

To insert text into vi or vim, you need to enter Insert Mode. Do this by pressing i.

Alternatively, press a to append, for example. Press o to insert text below the current line.

Once you're done, press Esc to leave the insert mode again.

There are lots of vi/vim commands for simple text manipulation, maybe print out a cheatsheet and try to learn the most important ones.

vi/vim Cheat Sheet

1
  • This is a good reference later on. May 9, 2012 at 19:59
1

If you are in normal mode, pres the "i" key to go to insert mode. The escape key takes you back to normal mode.

0

vi and vim are completely different from nano. With nano, you are able to use keyboard shortcuts to save files, open new ones and access other "non-text editing" functionality. vi/vim are different because they are modal: there is an Insert mode (which you have reached by accident) and a Normal mode. Insert Mode is equivalent to the normal functionality of an editor like nano, and Normal mode is specifically dedicated to commands. For example, to save a file in vim you enter :w (for write) in Normal mode.

I would suggest looking up and reading a vim tutorial. After running through the basics, you can start to digest the breadth and depth of vim functionality by looking at tips and cheatsheets. Definitely learn the basics first, though!

0

You must log in to answer this question.