[TxMt] Re: Commands in Textmate 2

Allan Odgaard mailinglist at textmate.org
Mon Nov 11 16:05:25 UTC 2013

On 11 Nov 2013, at 19:02, Geoff Vallis wrote:

> As a simple example, in Textmate 1.5, I wrote a command that opened a 
> Terminal window and listed the LaTeX master file, thus: […]
> require "#{ENV['TM_SUPPORT_PATH']}/lib/LaTeXUtils.rb"

This line is wrong. The ‘LaTeXUtils.rb’ file is in the LaTeX bundle.

> […] What would the correct script be? Please be explicit in any 
> answer you may have, as I am an end-user not a programmer!

Either you need to use TM_BUNDLE_SUPPORT and place your command in the 
LaTeX bundle or you need to set up your command to depend on the LaTeX 
bundle and then you can use TM_LATEX_BUNDLE_SUPPORT.

Probably the simplest step-by-step instructions would be to open the 
bundle editor in 2.0, select the LaTeX bundle, press ⌘N and select 
Command, then paste your old command source into the editor and change 
TM_SUPPORT_PATH to TM_BUNDLE_SUPPORT on the require line containing 

> More generally, is there a place I can read about how to construct 
> such commands in Textmate 2.

Ideally commands that worked in 1.x should work in 2.0 as well. Your 
command may have worked in 1.x because the LaTeXUtils.rb was in the 
global support folder, I don’t recall the exact file, but we had to 
put some of the LaTeX stuff in the global folder because it was used by 
completion commands that only had limited environment setup in 1.x.

More information about the textmate mailing list