Facebook

VI editor : Arrow keys and Backspace keys are not working properly.




It has been found that on a new installation of Ubuntu [lets say 13.04] , when you try to write some code in VI editor, the arrow keys are not working as expected.

It becomes very frustrating when you wants to navigate in the code using arrow key and instead of cursor moving up and down you see characters like A , B , C or D in middle of text.


To solve this problem you need to follow these steps -

1. Find your home directory using command 
    -  echo $ home
2. Navigate to your home directory
    - cd $HOME
3. Make a file. Name it ".vimrc" , use command
    -  vi .vimrc
4. Inside file write the text  "set nocompatible" (press I to enter in edit mode"
5. save the file 
    - Press 'esc'
    - enter :wq 
    -  hit enter



6.  Open vi editor. Try using arrow key. Now it should work fine.

 -------------------------------------------------------------------------------------------------------------------------

Also sometimes you see that backspace is working and sometimes it do not.
In default installation of VI, they do not install full package. In this default installation, the delete key deletes only the character it types in current edit mode. If you pressed escape key and then pressed insert key and types again, a new edit session is started.  To overcome this problem of delete key you need to install the full package of vim editor from package manager.





Happy Learning :)

If you liked the information then help it spreading by sharing this on Facebook or like the page Newbie.StayHungry .
 Thanks.

No comments:

Post a Comment