From owner-freebsd-questions Sun Aug 18 13:29:42 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA10803 for questions-outgoing; Sun, 18 Aug 1996 13:29:42 -0700 (PDT) Received: from shell.monmouth.com (pechter@shell.monmouth.com [205.164.220.9]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA10794 for ; Sun, 18 Aug 1996 13:29:39 -0700 (PDT) Received: (from pechter@localhost) by shell.monmouth.com (8.7.4/8.7.3) id QAA08194; Sun, 18 Aug 1996 16:25:55 -0400 (EDT) From: Bill/Carolyn Pechter Message-Id: <199608182025.QAA08194@shell.monmouth.com> Subject: Vi and arrow keys To: andrsn@andrsn.stanford.edu (Annelise Anderson) Date: Sun, 18 Aug 1996 16:25:55 -0400 (EDT) Cc: FreeBSD-questions@freebsd.org (FreeBSD-questions) In-Reply-To: from "Annelise Anderson" at Aug 18, 96 12:21:02 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Actually, there's a .exrc file in Unix Power Tools that works like magic and allows cursor use on vt100/ansi type terminals when used with vi. The main tip looks like this... map [A (cursor up ansi) to (end insert) i k (cursor up -- vi command) a (append -- vi command). You can do this for all the possible (up, down, left, right... as follows...) It seems to work in command mode with all vi's. Sometimes it seems to have problems with some systems... I'm writing this on a BSDI box where it doesn't seem to work in insert mode... (You DO need to do this for YOUR Terminal type. This should work for all ANSI terminal types). Here's a short piece of the .exrc I'm using which is hacked from the Unix ower Tools book. I recommend the book highly and think anyone working with Unix admin keep a copy handy for tricks and pointers as to how efficiently do neat Unix stuff... (Unfortunatly, the CD does NOT install directly from the ibcs2 i386 SCO compiled stuff to FreeBSD 2.2-current with ibcs2. The perl on the disk chokes on FreeBSD). "" "" Map ctrl-h, ctrl-j, ctrl-k and ctrl-l to to move the cursor during "" test-input mode, just as the commands h, j, k, and l do in command mode. map!  i map! ka map! la map!  ja " Note: the two lines above map ^J (LINEFEED) " " " For VT100 Terminals " set ai redraw showmode wm=1 set tabstop=4 set shiftwidth=4 "" cursor down while inserting map! OD ha map!  ha "" vt100 up arrow while inserting map! OA ka map!  ka "" cursor left while inserting map! OB ja map!  ja "" cursor right map! OC la map!  la ""