From owner-freebsd-questions@FreeBSD.ORG Tue Jun 12 17:22:20 2007 Return-Path: X-Original-To: questions@FreeBSD.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B41016A400 for ; Tue, 12 Jun 2007 17:22:20 +0000 (UTC) (envelope-from sgmayo@mail.bloomfield.k12.mo.us) Received: from mail.bloomfield.k12.mo.us (mail.bloomfield.k12.mo.us [204.184.27.92]) by mx1.freebsd.org (Postfix) with ESMTP id 2113C13C48C for ; Tue, 12 Jun 2007 17:22:20 +0000 (UTC) (envelope-from sgmayo@mail.bloomfield.k12.mo.us) Received: from [10.0.0.200] (unknown [204.184.27.217]) by mail.bloomfield.k12.mo.us (Postfix) with ESMTP id EA9472688FF; Tue, 12 Jun 2007 12:22:19 -0500 (CDT) Message-ID: <466ED64B.4070107@mail.bloomfield.k12.mo.us> Date: Tue, 12 Jun 2007 12:22:19 -0500 From: Scott Mayo Organization: Bloomfield Schools User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: doug@safeport.com References: <466D925A.3000009@mail.bloomfield.k12.mo.us> <20070612120229.F86945@fledge.watson.org> In-Reply-To: <20070612120229.F86945@fledge.watson.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: questions@FreeBSD.org Subject: Re: Backspace problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sgmayo@mail.bloomfield.k12.mo.us List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2007 17:22:20 -0000 doug wrote: > On Mon, 11 Jun 2007, Scott Mayo wrote: > >> I am not on any VI list, but thought I would post this here to see if >> anyone had any ideas. >> >> This is my first FreeBSD server, so I am still learning. >> >> I got my backspace and delete working the shell after a few >> adjustments, but they still act odd in VI. I have checked setting >> with my linux boxes (the backspace and delete work fine there) and >> everything looks the same. I did an stty -a | grep erase and it tells >> me that erase is Contral-? and erase2 is control-H. I have changed >> both around to make them either Ctrl-? or Ctrl-H, but that has not >> helped. >> >> If I hit backspace it just backs up on the line until were input-mode >> was started during this input-mode session. If I hit delete then it >> capitalizes the charcter behind the cursor and throws me into >> command-mode. >> >> I am not sure if there are anymore settings to change in FreeBSD or if >> it is a setting in VI. >> >> Any help would greatly be appreciated. >> > Scott, my stty -a: > > cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; > eol2 = ; erase = ^H; erase2 = ^@; intr = ^C; kill = ^U; > lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; > status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; > > IMO redefining keys is not a good thing if you are learning UNIX and vi. > In the default setup (I use tcsh for an interactive shell) ctrl-h is a > backspace and functions on the command line like the backspace key, > i.e., deletes the char to the left of the cursor. In vi the delete-key > == x in command mode (by default). The [del] key does not work on the > command line. > > I would advise getting comfortable with the default settings before > branching out. Key bindings and /etc/termcap changes have lots of > ramifications. vi is as it is because it was written when systems were > line oriented. The 'hjkl' are where your fingers sit if you are a touch > typist, and hence were chosen for that purpose. As late as 1995 vi on > BSDI (where I start on the BSD trail) did not support the cursor keys > very well. > > I have attached a vi cheat sheet that I found years ago. This is a > pretty good starter set of commands for vi. > > vi is not even as bad as it gets. vi is in /usr/bin so if your system is > really broken and you must edit something ed is the tool available in > FreeBSD. > Thanks for the info Doug. A friend of mine set me on the right path. I have been using vi in linux, except it was not vi. Vi was aliased to vim. I had installed vim on my FreeBSD server the other day, but that did not fix it. I found out that it has to be run with 'set nocp' so that it does not run in vi compatibility mode. I did this and now my backspace and delete work like I want them to. :) I appreciate the replies. -- Scott Mayo System Administrator Bloomfield Schools PH: 573-568-5669 FA: 573-568-4565 Pager: 800-264-2535 X2549 Duct tape is like the force, it has a light side and a dark side and it holds the universe together.