unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie<none@example.invalid>
Subject: Re: How can I do these in Emacs?
Date: Sat, 19 Apr 2003 07:46:03 +0000	[thread overview]
Message-ID: <rruq7b.r5.ln@acm.acm> (raw)
In-Reply-To: ph3ckfqbgr.fsf@wanglab.com

wang yin <wy@wanglab.com> wrote on 19 Apr 2003 13:53:56 +0800:
> Hi! I'm new to Emacs. I'm used to use VIM.  But I decided to enjoy the
> Emacs world.

Excellent!  There is plenty to enjoy.

> 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?

Not really.  Vim's o command can also be slow, though, since you often
have to press <ESC> first.  Or, it can be even slower if you forget the
<ESC>, the you end up pressing "o <ESC> u o".  ;-(

However, there is nothing to stop you writing a simple command (in Emacs
lisp) or a keyboard macro which would do exactly what you want.  C-o
would be a good key to bind this to.

> 2. How can I go to start or end of the if {...} block when the pointer
>    is inside the block?

> for example:

> 	if (w->backref != NOBACKREF) {
> 		WFhash[w->backref] = NULL;
> -----> <pointer here>	
>                 w->backref = NOBACKREF;
> 	}

C-M-u.  u stands for "up" here.  Play around with C-M-n and C-M-p, too.
They move forward and backwards over bracketed expressions.

The best way of discovering these things is in the emacs info pages,
though you've probably found these already.  In case you haven't, type:

C-h i       to get to info
m emacs     to select the emacs manual
Move the cursor down to line 75 (more or less).  There you'll see a menu
item "* Programs".  Go into this with <CR> and spend a few hours reading
the contents.  The bit about C-M-u is in the "Parentheses" item.

Have fun!

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

  reply	other threads:[~2003-04-19  7:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-19  5:53 How can I do these in Emacs? wang yin
2003-04-19  7:46 ` Alan Mackenzie [this message]
2003-04-19  7:57 ` Pascal Bourguignon
2003-04-19 14:39   ` Jiri Pejchal
2003-04-19  8:08 ` Eli Zaretskii
2003-04-19 19:08 ` Stefan Monnier
2003-04-19 19:32   ` David Kastrup
2003-04-19 21:40     ` Stefan Monnier
2003-04-22  0:20       ` Jason Earl
2003-04-22 14:16         ` Stefan Monnier
     [not found] ` <mailman.4924.1050736232.21513.help-gnu-emacs@gnu.org>
2003-04-21 17:36   ` David Masterson
2003-04-21 20:49     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rruq7b.r5.ln@acm.acm \
    --to=none@example.invalid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).