[OS X TeX] smart-Typing-Pairs with texshop
Diego Gruber
diego.gruber at gmail.com
Sun Dec 6 05:49:44 EST 2009
Hi Alan,
I'm fairly new to TeXShop and this list and was wondering the same thing a
few days ago. I found out there are several ways to do this. Not sure this
is the "proper" way but it works for me: you should modify the
autocompletion file (you find it in the Library->TeXShop->Keyboard folder...
do this in a program like TextWrangler and not within TeXShop, which for
some reason gave me lots of problems). Once you open the file and see what's
in there it's fairly obvious how it works. You can modify it so that when
you strike a certain <key> it automatically inserts the specified <string>,
including the selected text #SEL# and the cursor #INS# in the specified
positions. For example you could open a parenthesis and have TeXShop
automatically close it and put the cursor inside, perhaps enclosing selected
text within these parentheses. Then you would write
<key>(</key>
<string>(#SEL##INS#)</string>
For your second request I also found it very easy to define a new macro.
Open the macro editor and create a new item that for instance performs the
action (#SEL#) and assign it a keyboard shortcut. This will replace selected
text by (selected text), as requested.
Hope that helps,
Diego
On Sun, Dec 6, 2009 at 10:43, Alain Matthes <alain.matthes at mac.com> wrote:
> Hi
>
> I found any answer to this question on the net : how to get pair of
> brackets and parentheses
> automatically. I would like to get (..) [...] with only one action and
> like in TextMate
> I would like replace a "selected text" by "(selected text)" or "[selected
> text]".
>
> Is it possible with TexShop ?
>
> Best regards.
>
> Alain Matthes
>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20091206/e4398086/attachment.html>
More information about the MacOSX-TeX
mailing list