LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-30-2004, 12:52 PM   #1
arobic
Member
 
Registered: Jul 2003
Location: Geneva, Switzerland
Distribution: Debian 3.1, SLC3 (based on RHEL)
Posts: 84

Rep: Reputation: 15
Backspace key mapping in vi


Hi everyone!

This issue is driving me nuts since a while.

I am using a machine which has SuSE 7.2 installed and Vim 5.7.28 and the shell is zsh, for what it's worth. My problem is the following:

The backspace is working fine in the terminal (probably setup in the /etc startup file), but whenever I want to use it in vi, I obtain a big ^?. The delete key works, in deleting the following character, but not the previous one.

The thing is that I use another machine where this problem doesn't exist (different configuration). So I developped the habbit of using it and I keep using this freakin' backspace key (sorry for the abusive language ) on the other machine even if I know it doesn't work and I can't get myself not to do it!! So, I would really like to make it work!

I've look for threads in other forum through google of people having the same problem and it seems that there is no official well-known wide-spread solution (at least not yet)! One of the option was to set stty erase ^? since the delete key and the backspace key can be interchanged, but I obtain the following error message:
>stty: invalid integer argument

So, there seem to be a problem in using this command. Can it be shell related? Cause in bash this command works fine.

So, is there anyone on this forum who ever encountered the same problem and solved it? Anyone else who would like to fix it? I would really appreciate your help, cause I am sick of always having to erase every ^? I make in my vi display!!

Thanks in advance guys!

Last edited by arobic; 06-30-2004 at 02:03 PM.
 
Old 06-30-2004, 01:16 PM   #2
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 45
I have the following line in my ~/.vimrc
set backspace=indent,eol,start

If that doesn’t work, then hold down the Ctrl key and press backspace
at least as a temporary solution
 
Old 06-30-2004, 01:30 PM   #3
arobic
Member
 
Registered: Jul 2003
Location: Geneva, Switzerland
Distribution: Debian 3.1, SLC3 (based on RHEL)
Posts: 84

Original Poster
Rep: Reputation: 15
Thx for your reply Darthtux!

As you guessed, the set backspace didn't work, but the control-backspace works! How come?

Also, the stty problem is in fact shell related. I discovered that I have to use bindkey in zsh to do the key mapping and again:
bindkey "^H" backward-delete-char
bindkey -v "^H" backward-delete-char
bindkey "^H" vi-backward-delete-char

all these don't work. Why??

Also, I still have to figure out why my backspace give me a ^? in vi instead of a ^H ? Is that normal? If I use bindkey with ^?, will it work or will it screw up my terminal settings?

Any input on that?

Does somebody know about zsh a bit to help me?

Last edited by arobic; 07-01-2004 at 08:40 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backspace key in console frankie_DJ Solaris / OpenSolaris 3 08-06-2005 06:04 PM
fix backspace key? Jim Blackwood Linux - Laptop and Netbook 1 02-26-2005 08:29 PM
STTY and backspace key ministre Linux - Newbie 2 07-09-2004 01:46 PM
Getting a ^H on backspace key mlawler Linux - Software 1 04-28-2004 05:56 PM
Backspace key problem fr0zen Linux - General 0 12-23-2003 02:30 PM


All times are GMT -5. The time now is 11:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration