From owner-freebsd-questions@FreeBSD.ORG Mon Jun 15 16:12:05 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA371065670 for ; Mon, 15 Jun 2009 16:12:05 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 1BB408FC1F for ; Mon, 15 Jun 2009 16:12:05 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id ED61DEB5339; Mon, 15 Jun 2009 19:12:03 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id E27854509B; Mon, 15 Jun 2009 19:12:03 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 55fsnQ0fTK3D; Mon, 15 Jun 2009 19:12:03 +0300 (EEST) Received: from kobe.laptop (adsl105-76.kln.forthnet.gr [77.49.224.76]) by mail.ceid.upatras.gr (Postfix) with ESMTP id AFAD045088; Mon, 15 Jun 2009 19:12:03 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n5FGC34Z033065; Mon, 15 Jun 2009 19:12:03 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n5FGC1ZK033064; Mon, 15 Jun 2009 19:12:02 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Gary Kline References: <20090615024643.GA33420@thought.org> Date: Mon, 15 Jun 2009 19:12:01 +0300 In-Reply-To: <20090615024643.GA33420@thought.org> (Gary Kline's message of "Sun, 14 Jun 2009 19:46:45 -0700") Message-ID: <87fxe179ym.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: vim question... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 16:12:05 -0000 On Sun, 14 Jun 2009 19:46:45 -0700, Gary Kline wrote: > the main reason i don't use vim is because of its [u]ndo command. as > most of you can understand, there are a whole slew of times when i > need to undo something. too often in vim, hitting 'u' --- sometimes > > once accidentally --- has resulted in a small disaster. [[i have too > many current/recent copies of my working files to do TOO much > damage!]] Anyway, is there a means of setting the undo key to mimic > vi/nvi? Hi Gary, If you accidentally type 'u' in vim, you can "redo" it by ^R. There is also the "set compatible" option, but it isn't exactly "compatible" with the nvi behavior. In nvi, typing 'u' can undo the last operation. Then repeating the undo command with '.' keeps undoing changes until the buffer is reverted to its original state. In vim, with "set compatible" enabled", typing 'u' repeatedly toggles between the last two states of the buffer. In "compatible" mode I am not sure of how to undo multiple changes. In "set nocompatible" mode, typing 'u' repeatedly undoes multiple changes, and typing '^R' multiple times redoes them.