From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: make undo operate as in (no flames please) vim Date: Sat, 24 Jan 2009 23:41:03 -0800 (PST) Organization: http://groups.google.com Message-ID: <6896a596-8fba-4641-907d-fd84c701890c@v39g2000pro.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1232907086 32633 80.91.229.12 (25 Jan 2009 18:11:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2009 18:11:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 25 19:12:38 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LR9TB-00043o-G6 for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 19:12:29 +0100 Original-Received: from localhost ([127.0.0.1]:41699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR9Ro-0001lX-Vq for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 13:11:05 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v39g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1232869263 15686 127.0.0.1 (25 Jan 2009 07:41:03 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 25 Jan 2009 07:41:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v39g2000pro.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166299 X-Mailman-Approved-At: Sun, 25 Jan 2009 13:09:56 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61632 Archived-At: On Jan 24, 4:43 pm, Harry Putnam wrote: > I've used emacs for a goodly number of yrs now. I'd say though that > my usage is considerably less sophisticated than many users here. > > One thing I've actually come to dread is using undo. I've never taken > the time to get this setup in some way that seems more useful to me. > I always just go for the `C-x u' repeatedly or else preface with some > number (C-u 20 C-x u) to get close if lots of undos are needed. > > I often hit `C-x-u' (forgetting to release the C-x part) which brings > me to `upcase-region', which I keep disabled; that means I'm whisked > to a lengthy message about using `upcase-region' and generally > completely disrupting what I was doing. > > This is of my own making and not a fault of emacs, but still I'd like > to have the undo behavior I find in vim. It seems way closer to what > I usually want. Where I press some keycombo and a whole sentence or > whatever is undone. Instead of `C-x u' repeatedly to undo the same > line or even paragraph of type. > > I don't want to go to viper-mode. That seems a bit drastic, but can > anyone tell me how to setup `undo' to behave more like the undo found > in vim? Here's what i do: (global-unset-key (kbd "C-/")) ; undo (global-unset-key (kbd "C-_")) ; undo ;; undo and redo (global-set-key (kbd "M-Z") 'redo) (global-set-key (kbd "M-z") 'undo) you'll need to install the redo mode. You can find it on emacswiki.org . i use a full ergonomic based shortcut you might be interested. http://code.google.com/p/ergoemacs/ not sure exactly what vi undo behaves... perhaps you want emacs to lengeth each steps it consider for undo... don't have answer for that off hand. But if viper mode does it, you can easily customize emacs to do that without viper too. Xah =E2=88=91 http://xahlee.org/ =E2=98=84