From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Fernando Dobladez Newsgroups: gmane.emacs.help Subject: Re: command help : matching braces Date: Mon, 08 Apr 2002 12:07:43 -0500 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3CB1CE5F.9020604@fuego.com> References: <578F3C8F6DD3D411850600508BF320CAD014D6@aries-exch1.uk.eu.corp.vizzavi.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1018285980 10772 127.0.0.1 (8 Apr 2002 17:13:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 8 Apr 2002 17:13:00 +0000 (UTC) Cc: "'help-gnu-emacs@gnu.org'" Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16uchQ-0002nd-00 for ; Mon, 08 Apr 2002 19:13:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16ucgm-0003bp-00; Mon, 08 Apr 2002 13:12:20 -0400 Original-Received: from [65.201.108.41] (helo=saturn.fuegotech.com) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16ucf3-0003TZ-00 for ; Mon, 08 Apr 2002 13:10:33 -0400 Original-Received: from fuego.com ([192.168.0.224]) by saturn.fuegotech.com with Microsoft SMTPSVC(5.0.2195.4453); Mon, 8 Apr 2002 12:10:30 -0500 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311 X-Accept-Language: en-us, en Original-To: "Ambardekar, Shailesh" X-OriginalArrivalTime: 08 Apr 2002 17:10:30.0688 (UTC) FILETIME=[496C8200:01C1DF20] Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:61 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:61 If you miss VI's % too much, you'd probably like to include the following in your .emacs: (defun match-paren (arg) "Go to the matching parenthesis if on parenthesis, otherwise insert %. (Like in VI editor)" (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1))))) (global-set-key "%" 'match-paren) That will make the '%' go to the matching brace if the cursor is on a brace, and it will insert "%" otherwise. Fernando. Ambardekar, Shailesh wrote: >In gnu emacs 20.3.1 under Sun Solaris 2.6, >what is the emacs command for going to the matching brace ? >( looking for emacs equivalent of % vi command ). > >Thanks in advance. > >Shailesh > >