help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I do these in Emacs?


From: Pascal Bourguignon
Subject: Re: How can I do these in Emacs?
Date: 19 Apr 2003 09:57:48 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

wang yin <wy@wanglab.com> 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;
> -----> <pointer here> 
>                 w->backref = NOBACKREF;
>       }
> 
> Thanks.
 

-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
Do not adjust your mind, there is a fault in reality.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]