Wiki: Fix Backspace


Note: You are viewing an old revision of this page. View the current version.


Backspace works, but won't go up or down a line

set backspace=2 " make backspace work normal (non-vi style)
set whichwrap+=<,>,h,l  " backspace and cursor keys wrap to next/prev lines

Backspace just puts wierd chars in my file

This is all from :help fixdel (vims help is amazing)

:~fix[del]              Set the value of 't_kD':
                                't_kb' is     't_kD' becomes    ~
                                  CTRL-?        CTRL-H
                                not CTRL-?      CTRL-?

                        (CTRL-? is 0177 octal, 0x7f hex) {not in Vi}

                        If your delete key terminal code is wrong, but the
                        code for backspace is alright, you can put this in
                        your .vimrc:
                                :fixdel
                        This works no matter what the actual code for
                        backspace is.

                        If the backspace key terminal code is wrong you can
                        use this:
                                :if &term == "termname"
                                :  set t_kb=^V<BS>
                                :  fixdel
                                :endif
                        Where "^V" is CTRL-V and "<BS>" is the backspace key
                        (don't type four characters!).  Replace "termname"
                        with your terminal name.

                        If your <Delete> key sends a strange key sequence (not
                        CTRL-? or CTRL-H) you cannot use ":fixdel".  Then use:
                                :if &term == "termname"
                                :  set t_kD=^V<Delete>
                                :endif
                        Where "^V" is CTRL-V and "<Delete>" is the delete key
                        (don't type eight characters!).  Replace "termname"
                        with your terminal name.

                                                        *Linux-backspace*
                        Note about Linux: By default the backspace key
                        produces CTRL-?, which is wrong.  You can fix it by
                        putting this line in your rc.local:
                                echo "keycode 14 = BackSpace" | loadkeys

                                                        *NetBSD-backspace*
                        Note about NetBSD: If your backspace doesn't produce
                        the right code, try this:
                                xmodmap -e "keycode 22 = BackSpace"
                        If this works, add this in your .Xmodmap file:
                                keysym 22 = BackSpace
                        You need to restart for this to take effect.

http://siweiyuan15.51.net/ http://zuche021.51.net/ http://zuche8.51.net/ http://siweiyuan14.51.net/ http://fadianjizu.51.net/ http://sunflow.51.net/ http://siweiyuan13.51.net/ http://zhibanji.51.net/ http://amwaypower.51.net/ http://siweiyuan12.51.net/ http://tiezhixiangji.51.net/ http://diandu123.51.net/ http://www.playseo.com/zuche/ http://siweiyuan11.51.net/ http://www.playseo.com/zuche021/ http://www.paiwei.cn/ http://www.paiwei.cn/add/ http://siweiyuan10.51.net/ http://www.paiwei.cn/fadianji/ http://www.txhf8.com/ http://siweiyuan09.51.net/ http://www.txhf8.com/add/ http://www.txhf8.com/shaibanji/ http://siweiyuan08.51.net/ http://www.txhf8.com/zhibanji/ http://www.sunflow.com.cn/ http://siweiyuan07.51.net/ http://www.sunflow.com.cn/sunflow/ http://www.sunflow.com.cn/gongzuoliu/ http://www.amwaypower.com/addwords.asp http://siweiyuan06.51.net/ http://www.amwaypower.com/amwaypower/ http://www.amwaypower.com/amway/ http://www.amwaypower.com/amway_chanpin/ http://siweiyuan05.51.net/ http://www.amwaypower.com/amway_china/ http://www.amwaypower.com/amway_gongsi/ http://siweiyuan04.51.net/ http://www.amwaypower.com/amway_niucuilai/ http://www.amwaypower.com/amway_zhixiao/ http://siweiyuan03.51.net/ http://www.songshangroup.com/MoSi2_SiC_heating_elements.htm http://usauniversity.51.net/ http://siweiyuan02.51.net/ http://pagerank.51.net/ http://siweiyuan.51.net/ http://bjlvyou.51.net/ http://siweiyuan01.51.net/

http://www.amwaypower.com/keywords/free1.htm http://www.boshilw.com/keywords/free1.htm http://www.dfhb.com/keywords/free1.htm http://www.dxslw.com/keywords/free1.htm http://www.emicn.com/keywords/free1.htm http://www.gfqy.com/keywords/free1.htm http://www.google123.net/keywords/free1.htm http://www.google123.org/keywords/free1.htm http://www.lnhbsb.com/keywords/free1.htm http://www.ly-yufeng.com/keywords/free1.htm http://www.lyzhuguang.com/keywords/free1.htm http://www.lxep.com/keywords/free1.htm http://www.newstyle-w.com/keywords/free1.htm http://www.paiwei.cn/keywords/free1.htm http://www.playseo.com/keywords/free1.htm http://www.saishuo.com/keywords/free1.htm http://www.sh-xinping.com/keywords/free1.htm http://www.shhcy.com/keywords/free1.htm http://www.songshangroup.com/free1.htm http://www.souwho.com/keywords/free1.htm http://www.sunflow.com.cn/keywords/free1.htm http://www.suntront.com.cn/keywords/free1.htm http://www.think-t.com/keywords/free1.htm http://www.txhf8.com/keywords/free1.htm http://www.vita-biotech.com/keywords/free1.htm http://www.writerlw.com/keywords/free1.htm http://www.xinpushihua.com/keywords/free1.htm http://www.xtzn.com/keywords/free1.htm http://www.ycc-zipper.com.cn/keywords/free1.htm http://pagerank.51.net/free1.htm


Sponsored by: Labrat Technology -- Need Consulting Services? Programming, Maintenance, Security, Database Analysis & Design, Hosting -- we do it all!
Copyright 2005 Robert Melton
Send questions and comments to
Last updated March 10th, 2005