[TxMt] TM2: opening a collection of files with mate command
Stephen Bannasch
stephen.bannasch at deanbrook.org
Wed Feb 22 19:31:47 UTC 2012
Here's a pattern I've often used in TM1 -- that doesn't work as well in TM2.
I've got a big project and want to either easily browse just a subset of files or I'm doing some complicated refactoring with
regexes etc and dealing with just a subset would make my work much less error prone.
I use the grep replacement ack to find files meeting some criteria and pipe this list with xargs to the mate command.
The files appear in mate in the project drawer and are easily browsable and searchable as a set.
Here's an example where I want to work with only the files from the src/ dir in my project that have the string 'cursor'
(there's a generated dist/ dir tree that ALSO has many files with the string 'cursor' in them but I don't want to deal with
those files):
$ ack -l cursor src
src/examples/complex-atoms-model/application.sass
src/examples/components/components.sass
src/examples/examples.sass
src/examples/lennard-jones-potential/lennard-jones-potential.js
src/examples/simple-atoms-model/application.sass
src/examples/simple-atoms-model-controls-in-text/application.sass
src/examples/simplemolecules/simplemolecules.sass
src/index.sass
src/lab/css/components.sass
src/lab/grapher/samples/cities-sample.js
src/lab/grapher/samples/lennard-jones-sample.js
src/lab/grapher/samples/sample-graph.js
src/lab/grapher/samples/simple-graph2.js
src/lab/grapher/samples/surface-temperature-sample.js
src/lab/graphx/graphx.js
src/lab/layout/fullscreen.js
src/lab/layout/potential-chart.js
src/tests/two-graphs/index.html
Load those files in both TM2 and TM1:
$ ack -l cursor src | xargs mate
$ ack -l cursor src | xargs mate1
In TM1 the files appear in the project drawer and the project search for cursor gives me all the locations in this collection
of files.
However in TM2 the files do NOT appear in the project drawer (they are instead all opened as separate tabbed windows) and are
not searchable as a collection.
Here's a screenshot caompring the two TM versions and the results of a search for files with the string 'cursor':
https://img.skitch.com/20120222-t6xxnk342b6wsgwjeh1ckyykmf.jpg
I'd like an arbitrary collection of files passed to TM2 via the mate command to be represented and searchable as a collection.
More information about the textmate
mailing list