LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't delete in VI (https://www.linuxquestions.org/questions/linux-newbie-8/cant-delete-in-vi-868814/)

j360 03-15-2011 09:33 PM

Can't delete in VI
 
Hi, I'm taking a C programming class in college and we use VI text editor. I installed ubuntu on my computer so I can study. Every time I try to use Vi on my computer I'm able to type and delete using the delete button, but I can't delete using the backspace button. Every time I press it it only moves back on character. How can I solve my problem?

lupusarcanus 03-15-2011 09:34 PM

Press "I" to enter insert mode then try it. (In Vi)

frankbell 03-15-2011 09:47 PM

In command mode, backspace does not delete in vi.

There's a nice cheat sheet here:

http://www.viemu.com/a_vi_vim_graphi..._tutorial.html

I made myself my own cheat sheet based on this book. It's got the best intro to vi that I've ever seen.

You are welcome to download my cheat sheet here:

j360 03-17-2011 06:24 PM

Thanks but none of the worked. I use Linux in school( through SSH) and I'm able to delete using backspace. I tried the cheat sheet d it didn't work. How can I uninstall VI so I can reinstall it again? maybe that fixes it.

lupusarcanus 03-17-2011 09:37 PM

Is your computer a laptop? If so, try fn + backspace and see what happens.
Do you know how to use Vi? (not meaning to be rude, but Vi can be confusing)

frankbell 03-17-2011 09:43 PM

In using vi, it's important to be clear whether you are in command mode or text entry mode.

As I have tried to learn vi, that has been the single most difficult thing for me to get the hang of.

In my vi in text entry mode, backspace moves the cursor to the left, but does not delete the text as it passes over it. When I start typing from the new position, it replaces the text starting at the new cursor position.

In command mode, backspace also moves the cursor but does not delete the text. It does not appear to be able to move the cursor farther than the beginning of that line, again, in command mode. I cannot enter text until I return to text entry mode (ESC text-command).

j360 03-17-2011 10:31 PM

Quote:

In my vi in text entry mode, backspace moves the cursor to the left, but does not delete the text as it passes over it. When I start typing from the new position, it replaces the text starting at the new cursor position.

In command mode, backspace also moves the cursor but does not delete the text. It does not appear to be able to move the cursor farther than the beginning of that line, again, in command mode. I cannot enter text until I return to text entry mode (ESC text-command).
that's what happens to me, but I don't want that. I want to delete the character when backspace because that's how i do it on the Linux server at school. Anyway that can be fixed, or I'll have to get used to it XD

Tinkster 03-18-2011 12:04 AM

That's not a vi problem, but a terminal one. Which terminal emulator are
you using?

j360 03-18-2011 06:58 PM

Quote:

That's not a vi problem, but a terminal one. Which terminal emulator are
you using?
you mean in school?
we use putty

frankbell 03-19-2011 09:55 PM

Quote:

Originally Posted by j360 (Post 4294576)
that's what happens to me, but I don't want that. I want to delete the character when backspace because that's how i do it on the Linux server at school. Anyway that can be fixed, or I'll have to get used to it XD


After I wrote this, I should have specified that I'm actually using vim ("vi-improved") rather than original vi. I don't know whether it makes a difference, but I was kicking myself for not mentioning it earlier.

This Wikipedia article discusses vi and its variants.


All times are GMT -5. The time now is 03:02 AM.