4

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

4
  • 5
    Unless you are posting your question from the 80s or early 90s, vi is very often a symlink to vim.
    – romainl
    Oct 26, 2012 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, 2012 at 15:42
  • 1
    @AdelQodmani, vi(m) questions are on topic for SO.
    – Kristo
    Oct 26, 2012 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, 2012 at 18:07

3 Answers 3

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".

2
  • 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, 2012 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. Oct 26, 2012 at 18:33
5

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'
5

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

sudo apt-get install vim-gui-common
sudo apt-get install vim-runtime

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .