19

Recently I installed ubuntu in my laptop for using c programming. but when I open the terminal and typed vi test.c, It open it but it will not work properly. when i pressed backspace it will not work and when i press arrow key it will print some alphabets. What will i do to work properly. please anybody help for this related problem. thank you

  • 1
    vi is very powerful but not very intuitive to use there is a turorial here or you can use another editor such as nano – Warren Hill May 10 '13 at 9:19
28

Type sudo apt-get install vim

in your terminal, this will solve your problem

  • Yes user is probably used to VIM which is much more intuitive and easier to use especially for programming since it can provide syntax highlighting. – brim4brim Jun 1 '13 at 18:41
17

By default, Ubuntu will install vim-tiny, a bare-bones version of vim. When you type vi in the terminal, it will start this minimal vim in vi compatible mode by default. From a normal vim user's standpoint, this is horrible, since vi compatible means backspace and all the normal vim behavior will behave in the original vi manner.

One solution is to open up .vimrc and turn off vim compatible mode by including the line: set nocompatible.

The other is to manually install more feature-filled version of vim (like the full version), e.g. sudo apt-get install vim. By default, on Debian-based systems like Ubuntu, this will make the command vi start vim up in non-compatible mode.

  • This does not change anything on my Ubunto 16.04. ("vim is already the newest version".) – Dirk Jul 26 '17 at 19:32
1

Generally UBUNTU ships lite version of VI that most incomplete, especially with laptops. To resolve this easiest solution is to install FULL VERSION of VI Editor.

Use TERMINAL, and fire this

sudo apt-get install vim

provide password and it will definitely work.

1

I had the same problem, remember that after typing test.c you have to press key "i" in order to start typing your code

0

press the insert key to type/delete.

when you're finished editing, pressing esc will allow you to type commands like :wq (save and quit) or :q! (quit without saving)

0

first connect to internet then type following command in terminal,

sudo apt-get update
sudo apt-get install vim

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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