From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jiri Pejchal Newsgroups: gmane.emacs.help Subject: Re: How can I do these in Emacs? Date: Sat, 19 Apr 2003 14:39:04 GMT Organization: unknown Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87y926nclf.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050764231 21023 80.91.224.249 (19 Apr 2003 14:57:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 19 Apr 2003 14:57:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 19 16:57:09 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 196tm9-0005Sx-00 for ; Sat, 19 Apr 2003 16:57:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 196tkW-00057u-02 for gnu-help-gnu-emacs@m.gmane.org; Sat, 19 Apr 2003 10:55:28 -0400 Original-Newsgroups: gnu.emacs.help Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!propagator3-maxim!news-in.superfeed.net!news.cesnet.cz!crax.cesnet.cz!news.vutbr.cz!news.muni.cz!news User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Lines: 23 X-Nntp-Posting-Host: nymfe04.fi.muni.cz Original-Xref: shelby.stanford.edu gnu.emacs.help:112119 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:8618 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8618 Pascal Bourguignon writes: > > 1. How can I do something like a "o" command in vi with Emacs? I > > always C-e to the end of the line and press RET. Are there any > > faster ways? > > (defun open-line-a-la-vi () > (interactive) > (forward-line) > (open-line (or prefix-arg 1))) > (global-set-key "\C-o" 'open-line-a-la-vi) Thanks! That's cool. What about this: (defun open-line-a-la-vi () (interactive) (forward-line) (open-line (or prefix-arg 1)) (indent-according-to-mode)) ;;and indent too (global-set-key "\C-o" 'open-line-a-la-vi) Jiri Pejchal