Linux Linux Vi editor problem

crvinay_4u

Disciple
I started using linux to practise my c programs a few days back.When ever I use Vi editor on the ubuntu platform the backspace key does not work as expected also the delete key works as Caps key and the arrows key when used results in writing A B C D alphabets and the keys above the Ins and Del results in others alphabets like M N etc..pls help.

tia :)
 
Vi is an advanced editor. So first learn to use it. Vim - Notes

It wont work like that.

Like to go from command mode to editing mode : i(small)

Editing mode to command mode : Esc

To save and exit : :wq

Delete a char : x

Delete a line : dd (I hope, forgot, so check it)

Deleting n lines : ddn Eg. dd4 will delete 4 lines from the current cursor position.

The behavior of arrow keys is fulfilled by g-h-j-k (may be, forgot again, so check it out)
 
Look, yes VIM do work out of the box as we are used to(in windows). But originally Vi is designed and programmed to work in the way I specified.
 
:wq saves the file and exits from vim.

To ensure do try :wq in editing mode, it'll just print :wq as it is.

As far I remember there are 3 modes in vi(not sure, forgot :P)

BTW there are number of tutorials for vim, just google it out, or read the "A Byte of VIM" by Swaroop C H, the link I already gave you in my first post.
 
Vi is brilliant if you know how to use it. If not use Nano or Pico. Both are much easier. But some times knowing Vi can save you a lot of time.
 
^^ We are taught c in Vi in our college so have to use that only,but i am open to learning how to use nano also.I am using ubuntu 10.10 so i dont think vi in my ubuntu is an older version.
 
Well, it's never like if you being taught to write programs in vi you can't use nano. Both are just an editor so it's the matter of your choise, as I can surely say maximum peoples use emacs or gedit, kate/kwrite(in kde) as their preferred editor. So it simply doesn't matters, just use whatever you are comfortable with.

Well, no vim in Maverick is not older, but really I've no idea why it behaves like vi.
 
vishalrao said:
To avoid the "wierd behaviour" you probably need to edit the .vimrc options file in your home directory and put the "set nocompatible" entry in there...

See .vimrc and customization - Jonathan McPherson (after searching for "vimrc options")
I coudn't find any ~/.vimrc, it's not there. Should I create it manually??

I guess Ubuntu uses vi, not the vim(newest version), that's why so much problem with vi in Ubuntu, others please correct me if I'm wrong.
 
On my Ubuntu 10.10 /usr/bin/vi points to /etc/alternatives/vi which points to /usr/bin/vim.basic :)

I installed the vim-full package to get the "vi" command.

Yes if ~/.vimrc is not there you need to create it - I dont have it either and dont seem to face this problem.

Maybe you installed plain old vi, so uninstall it and install "vim-full" package :)
 
Well...doesn't matter to me :)

I didn't installed anything, it came pre-installed :)

Anyway...as I guessed :P

I don't use vi/vim though, I prefer nano :)
 
Back
Top