[TxMt] Re: LaTeX bundle requests

Guido Governatori guido at itee.uq.edu.au
Thu Oct 11 22:48:50 UTC 2007


On 10/10/2007, at 5:51 PM, Ruben Debeerst wrote:

>
> You can simply define your own commands. For Tab-Move-Out-Of-Math- 
> Mode I would record a Macro:
> search for "\$(\$)?|\\\]"
> and move cursor right
> Save this as a command, set the key to tab, and restrict the scope  
> to "string.other.math.tex".

Thanks for the suggestion. Indeed I have created a macro for this  
(with a little more complicated regexp to use it also to exit from  
environments). But I found that the tab key was not the best option,  
since associating it with the macro will prevent its normal use. So I  
have associated with it backtab (shift-tab).

> Since sub/superscript have not an own scope it will be not so easy  
> to do the things you would like to do with them. But maybe the  
> example above shows how things are working in Textmate.

I have created simple snippets for them, so tab can be used to move  
out the sub/superscript.

>
> For you other problem:
> I read somewhere that "a-esc" will cycle through commands starting  
> with a, but I can't find it right now.

Correct "\a-esc" will cycle though commands starting with a (but  
there could be too many commands before you get the right one or you  
have to type the almost full name of it).

I have created a command that extends the behaviour of the LaTeX  
Symbol Based on Current World / Selection command of LaTeX Bundle. It  
works also with non-word characters (though it must be called using a  
macro). Though I'm not sure I have understood correctly the behaviour  
of the input output of command from the Bundle Editor, in particular  
the combination

Input: Selected Text or Word
Output: Replace Selected Text

If some text is selected fine, no problems. Now if no text is  
selected, the input is the current word. What about the output? If  
the selection contains only word character, then the word is  
replaced, but then if the current word (obtained from the environment  
variable TM_CURRENT_WORD) contains non-word characters then the  
replacement text is appended; it seems to me that it should replace  
the input.

I have another question:

Given a scope as input, is there any way to move or select text to  
the end/begin of the current scope?

Regards,

Guido

--
Dr Guido Governatori
School of Information Technology and Electrical Engineering
The University of Queensland
Brisbane, Queensland, 4072, Australia
Phone: +61-(0)7-336 52907
Fax: +61-(0)7-336 54999
http://www.itee.uq.edu.au/~guido  http://www.governatori.net
http://www.defeasible.org





More information about the textmate mailing list