开发者

How do I make a TextMate macro to open all files in my project that match a regular expression?

开发者 https://www.devze.com 2023-03-19 15:21 出处:网络
How do I make a TextMate macro to open all files in my project that match the regular e开发者_如何学Cxpression,\"/todolist/i\"?I solved this in perl, by creating a command.It requires to have a file i

How do I make a TextMate macro to open all files in my project that match the regular e开发者_如何学Cxpression, "/todolist/i"?


I solved this in perl, by creating a command. It requires to have a file in the project already open in order for the hotkey to work. Perhaps there is no way around this, since while a file is not open in the project, the command is greyed out in the Bundle menu. Maybe there's a hotkey to open some file in the project (or some other way to get the command un-greyed)? I'd like to just press a sequence of hotkeys.

#!/usr/bin/perl

use strict;
use warnings;
use File::Basename;
use File::Find;

my $dir = dirname($ENV{'TM_DIRECTORY'});
my $textmate_path = $ENV{'TM_SUPPORT_PATH'} . '/bin/mate';
find(sub { system(qw/mate/, $File::Find::name) if /TODOLIST/ }, $dir);
die;
0

精彩评论

暂无评论...
验证码 换一张
取 消