From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: How can I do these in Emacs? Date: 19 Apr 2003 09:57:48 +0200 Organization: informatimago.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87y926nclf.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050739209 23694 80.91.224.249 (19 Apr 2003 08:00:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 19 Apr 2003 08:00:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 19 10:00:02 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 196nGT-00069N-00 for ; Sat, 19 Apr 2003 10:00:01 +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 196nGw-00016q-02 for gnu-help-gnu-emacs@m.gmane.org; Sat, 19 Apr 2003 04:00:30 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!thalassa.informatimago.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: thalassa.informatimago.com (195.114.85.194) Original-X-Trace: fu-berlin.de 1050739118 3890061 195.114.85.194 (16 [41911]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu gnu.emacs.help:112114 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:8613 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8613 wang yin writes: > Hi! I'm new to Emacs. I'm used to use VIM. But I decided to enjoy the > Emacs world. > > I don't know how to do something that's simple in VIM. I hope I can > get help here. > > 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) > 2. How can I go to start or end of the if {...} block when the pointer > is inside the block? See functions up-list, forward-list, backward-list. The terminology is lisp, but they work correcly in other syntaxes too. For example, beginning-of-defun moves to the beginning of the function in C mode, where there is no defun like in lisp. You can attach them or a combination of the to a key like above. > for example: > > if (w->backref != NOBACKREF) { > WFhash[w->backref] = NULL; > -----> > w->backref = NOBACKREF; > } > > Thanks. -- __Pascal_Bourguignon__ http://www.informatimago.com/ ---------------------------------------------------------------------- Do not adjust your mind, there is a fault in reality.