On Tue, Mar 13, 2012 at 17:05, Tim Chase <[email protected]> wrote:
>> This expression will go back to one of the character pairs:
>> ?\({}\|[]\|()\|""\|''\)
>>
>> However, is there any way to restrict it to the current line?
>
>
> Your mapping could include the line, something like (untested)
>
>  :nnoremap <f4> ?<bslash>%<c-r>=line('.')<cr>l\({}\|[]\|()\|""\|''\)<cr>
>
> which populates the /\%l atom with the current line-number making use of
> control-R to insert the result of evaluating an expression (in this case,
> calling line() to get the current line#).
>
>  :help /\%l
>

Thank you very, very much Tim. I have been playing with a few
combination of this for about an hour or three, but all the VIM
scripting knowledge that I have is that which has been acquired in
those few hours! I see that I am going down the wrong track.

I have been wandering helplessly through the fine manual. Perhaps you
could suggest what parts of the manual I should be concentrating on
for this endeavour? I did read the help section that you mentioned,
and those around it, but I still cannot get the pattern to even match
at all in a scripted solution!


> You might also be interested in adding "><" to your list of search items as
> your link suggests you might want to land at a tag junction.

Right, thanks! I will add them after I get the current matches working.


> Also, you
> could shift your destination with an offset if you land one before/after
> your desired location:
>
>  :help {offset}
>

Actually, "a" does in fact insert into the desired location between
the parentheses.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

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

Reply via email to