From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: make undo operate as in (no flames please) vim Date: Sun, 25 Jan 2009 09:28:21 +0100 Organization: FH-Trier Message-ID: <1232872165.143769@arno.fh-trier.de> References: <6896a596-8fba-4641-907d-fd84c701890c@v39g2000pro.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1232872860 22126 80.91.229.12 (25 Jan 2009 08:41:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2009 08:41:00 +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 09:42:11 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 1LR0ZC-00056n-3D for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 09:42:06 +0100 Original-Received: from localhost ([127.0.0.1]:60130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR0Xt-0001E4-Sh for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2009 03:40:45 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1232872231 22728 143.93.54.11 (25 Jan 2009 08:30:31 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Sun, 25 Jan 2009 08:30:31 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) In-Reply-To: <6896a596-8fba-4641-907d-fd84c701890c@v39g2000pro.googlegroups.com> Cache-Post-Path: arno.fh-trier.de!unknown@dslb-084-059-111-171.pools.arcor-ip.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: news.stanford.edu gnu.emacs.help:166300 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:61620 Archived-At: Xah Lee wrote: > 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 > ∑ http://xahlee.org/ > > ☄ Remember, vi was that mode beast. It is easier to undo the correct choice of characters, if you tell the editor where it starts and ends (via mode switch). -ap