Sunday, May 9, 2010

Re: Jumpnig inside a C-function definition

On 09/05/10 06:46, meino.cramer@gmx.de wrote:
> Tony Mechelynck<antoine.mechelynck@gmail.com> [10-05-09 06:36]:
>> On 09/05/10 06:17, meino.cramer@gmx.de wrote:
>>>
>>> Hi,
>>>
>>> at work I am using vim as the editor under Windows XP
>>> for developing C-code.
>>>
>>> I want to jump to the beginning and to the end of
>>> the function where the cursor is currently being
>>> psoitioned. I want to start the jump from anywhere
>>> inside that funtion and dont want to jump to the
>>> beginning/end of the sorrounding block.
>>>
>>> I had experimented with [[,][ and sisters but that
>>> even jumps out of the current function, which is
>>> correct (according to the help text) but not what
>>> I tried to acchieve...
>>>
>>> How can I accomplish this ?
>>>
>>> Have a nice wekend! :)
>>>
>>> Best regards,
>>> mcc
>>>
>>
>> I would have thought that (with "typical" coding styles) ][ would bring
>> you to the closing } of the current function, and then % would bring
>> you to the opening { (even if at the end of the line containing the
>> function declaration).
>>
>>
>> Best regards,
>> Tony.
>> --
>> One difference between a man and a machine is that a machine is quiet
>> when well oiled.
>>
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>>
>
> Hi Tony,
>
> when on } (end of function) and you press accidentily ][ the cursor jumps to next
> } (end of next function.

Yes, but then you can hit Ctrl-O (control-oh) to go back where you were,
and then hit % if needed. Or else,

:map <F5> k][
:map <S-F5> <F5>%

>
> The main problem is, that the jumps are not bound to the function the
> cursor is in.
>
>

Best regards,
Tony.
--
Valerie: Aww, Tom, you're going maudlin on me ...
Tom: I reserve the right to wax maudlin as I wane eloquent ...
-- Tom Chapin

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: