Hi All,
I am coding Scheme (you know, the language that has more parenthesis in it than code *g*) and I would like my cursor to bounce back to its matching left parenthesis when I typed a right parenthesis (just like what Emacs does).
Is there a setting or macro that will allow me to do this?
Thanks a bunch!
Matching Parenthesis
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: Matching Parenthesis
You could create a macro that does <b>Ctrl-M Ctrl-M Cursor-Right</b> and assign it to the <b>)</b> key.
Re: Matching Parenthesis
Shouldn't that be ")" Ctrl-M Ctrl-M Cursor-Right ? Otherwise you can't add a real ")" ... This is another example of where Doc Class specific Macros are needed ... you don't want that while typing regular text. It would be better to assign it to Ctrl-")"... and train yourself to close parentheses in that language with the Ctrl version.
Re: Matching Parenthesis
Uuuups. I did not create such a macro, so the parenthesis slipped by...
Nobody is perfect - I am somebody!
Andreas
Nobody is perfect - I am somebody!
Andreas
Re: Matching Parenthesis
I have tried both methods:-
[1] Ctrl-M Ctrl-M Cursor-Right ...
[2] ')' Ctrl-M Ctrl-M Cursor-Right ...
and assign it to the ')' key.
but none of them seemed to work. after i assigned it to the ')' key, hitting the ')' key does not print the ')' character anymore (and thus nothing to match).
these are my steps for method [2]:-
i type '(abc', then record macro. i type in ')', then Ctrl-M Ctrl-M and move cursor to the right. then i save the macro. then, go to Preferences -> Keyboard and select Marcos. and assign my macro to the key ')'.
did i miss anything?
thanks for your time.
[1] Ctrl-M Ctrl-M Cursor-Right ...
[2] ')' Ctrl-M Ctrl-M Cursor-Right ...
and assign it to the ')' key.
but none of them seemed to work. after i assigned it to the ')' key, hitting the ')' key does not print the ')' character anymore (and thus nothing to match).
these are my steps for method [2]:-
i type '(abc', then record macro. i type in ')', then Ctrl-M Ctrl-M and move cursor to the right. then i save the macro. then, go to Preferences -> Keyboard and select Marcos. and assign my macro to the key ')'.
did i miss anything?
thanks for your time.
Re: Matching Parenthesis
I'm not familiar with EMACS so I took the Ctrl-M,Ctrl-M,Cursor-Right at face value ... looking at your description I'd say ")",Ctrl-M,Cursor-Right is more what you want. (a single Ctrl-M sends it back to the matching open "(", the *second* one would send it back to the closing one just typed, effectively doing nothing) ...
Re: Matching Parenthesis
I did not try it - I thought the first Ctrl-M would move the cursor to the opening ( and the second would move it back - which would emulate the short flashing of the cursor at the matching ( of emacs.
It might be that the macro interpreter does not flash the cursor at the opening (
Andreas
It might be that the macro interpreter does not flash the cursor at the opening (
Andreas