[TxMt] Commands in Textmate 2

Geoff Vallis gkv at princeton.edu
Mon Nov 11 12:02:30 UTC 2013


Hello,

I'm transitioning to Textmate 2 and I would like to use some 'commands' that I used with Textmate 1.5, mainly for LateX, but I am having trouble.

As a simple example, in Textmate 1.5, I wrote a command that opened a Terminal window and listed the LaTeX master file, thus:

---------------------------------
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"

TM_LATEX_MASTER=`${TM_RUBY:-ruby} <<"RUBY"
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/LaTeXUtils.rb"

master = LaTeX.master(ENV['TM_LATEX_MASTER'] || 
ENV['TM_FILEPATH'])
puts master
RUBY`

cd ${TM_DIRECTORY}
/Users/gkv/scripts/term2 "echo ${TM_LATEX_MASTER} " 

-------------------------------------

The script 'term2' opens a terminal window and executes the command following. This command now longer works in Textmate 2. However, Textmate 2 certainly knows what the master file is, because the standard Textmate command for opening the master file works as expected. What would the correct script be? Please be explicit in any answer you may have, as I am an end-user not a programmer! 

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

Regards,
Geoff




More information about the textmate mailing list