3

Solved this problem in my Ubuntu box by installing Vim. I keep having this problem in every linux box I use. But I keep installing vim (over the existing vi)

The problem is, I can't get that "INSERT" sign at the bottom. The cursor is a black box and not a underscore-looking dash. When I backspace, it just goes over the text. Then when I type something new, the text starts getting replaced one by one. I hope you got it.

----------

I'm changing the question!

:set showmode gave me the "INSERT" mode. But still, when I backspace, the cursor goes over the text and when I type, it starts getting replaced one-by-one.

Here's a video of my problem: http://www.youtube.com/watch?v=16f1nrepZsA

  • 5
    Unless you are posting your question from the 80s or early 90s, vi is very often a symlink to vim. – romainl Oct 26 '12 at 15:13
  • I don't think this question belongs to stackoverflow.<br> Questions here should be related to programming. stackoverflow.com/faq#questions – Fingolfin Oct 26 '12 at 15:42
  • 1
    @AdelQodmani, vi(m) questions are on topic for SO. – Kristo Oct 26 '12 at 18:02
  • I've added a screencast. Its less than 1min. Can some experts please look into it? I've had this problem for ages. Its high time it gets solved. – Sreejith Ramakrishnan Oct 26 '12 at 18:07
5

1) the "INPUT MODE" or "INSERT" indicator can be switched on by "set showmode". You can put that in your ".exrc" file in your homefolder to make it the default. If the showmode is not switched on you're still in insert mode if you hit "i". It's just not shown.

2) typing backspace in command mode is like moving the cursor from right to left. It's the intented behaviour. To actually delete characters type "x" or "X".

| improve this answer | |
  • I tried "set showmode" and now I'm seeing the "Insert". But, I still can't backspace while in INSERT mode. The same thing (cursor goes text) occurs. Anyway to resolve this? – Sreejith Ramakrishnan Oct 26 '12 at 16:11
  • 1
    @pitseeker is correct. The backspace behavior your are experiencing is correct for vi. I would highly recommend installing vim because backspaces issues are nothing compared to one level of undo. – Peter Rincker Oct 26 '12 at 18:33
3

This backspace "problem" is merely vi compatible behavior; since vi is almost certainly a symbolic link to vim, the presence of a ~/.vimrc—even if it is an empty file—should automatically fix your backspace issue. If not, I recommend putting ":set nocompatible" in your ~/.vimrc or at least ":set cpoptions-=v"

See (the single-quotes are meant to be part of the command):

:help 'compatible'
:help 'cpoptions'
| improve this answer | |
1

The way I fixed these problems was by installing these packages.

sudo apt-get install vim-gui-common
sudo apt-get install vim-runtime
| improve this answer | |

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.