Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
4  
Hint: Install Vim and run vimtutor. –  grawity May 9 '12 at 19:51
add comment

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
nice! thanks :) –  Sandro Dzneladze May 9 '12 at 19:58
    
This is a good reference later on. –  Alex Hirzel May 9 '12 at 19:59
add comment

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

share|improve this answer
add comment

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!

share|improve this answer
    
I will, thanks! –  Sandro Dzneladze May 9 '12 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.