As a recovering vimaholic, I miss special highlighting of (FIXME|TODO|
XXX) in my source. (I realize that I can get a list of TODOs with C-
S-t, but it's nice to have things like "XXX: broken" or "FIXME
dsandler:" leap out at me as I'm skimming code.)
I seem to be able to hack these rules into individual languages; for
example, in Python, I changed the comment.line.number-sign.py pattern
thusly:
{ name = 'comment.line.number-sign.py';
begin = '#';
end = '$';
patterns = (
{ name = 'todo.todo';
match = '(TODO)( \S*:|:?)';
},
{ name = 'todo.fixme';
match = '(FIXME)( \S*:|:?)';
},
{ name = 'todo.xxx';
match = '(XXX)( \S*:|:?)';
},
{ name = 'todo.changed';
match = '(CHANGED)( \S*:|:?)';
},
);
},
(This seemed to require changing Python's line-comment pattern from a
'match' to a begin/end kind of thing.)
With these scopes, you can now set all TODOs to a given color, or
pick different colors for each, etc. (perhaps matching the colors up
with those in the "Show TODO List" command).
So, is there any way to apply this kind of new scope to to (comments
in) all languages at once, or do I (or the TextMate BDFL) have to go
and integrate it into each one by hand?
Thanks,
--ds
Hello everyone,
The short story is that running ARD (Apple Remote Desktop) Client is
the culprit that is stealing the key sequence.
I don't know why ARD steals the key sequence, but turning it off
(System Preference - under Sharing) eliminates this problem for me.
I'd like to run the ARD client, so if anyone knows how to have the
ARD client run without it stealing the crtl-esc key sequence, I'd
like to hear about it.
I hope this ends the problem for others as well.
peace,
icb
Ira Cary Blanco
Marketing & Media
Samson Technologies Corp.
Samson | Hartke | Zoom
voice: 631.784.2200 x107
fax: 631.784.2201
email: blanco(a)samsontech.com
web: samsontech.com
Hi,
I've been using TM for quite some time now and it's a great editor.
The last weeks I had to write some code for a site using MODx
(www.modxcms.com)
MODx uses some special tags:
[[Snippet]]
[!Noncaching-Snippet!]
{{Chunk}}
[~link~]
[*attribute*]
I added some code to the HTML-Bundle for recognizing this which works
quite good.
modx = { patterns = (
{ name = 'meta.tag.inline.modx.snippet';
begin = '(\[\[)(\w*)(.*?)';
end = '(\]\])';
captures =
{ 1 = { name = 'punctuation.modx.snippet'; };
2 = { name = 'entity.name.tag.modx.snippet'; };
};
},
{ name = 'meta.tag.inline.modx.snippet.nocache';
begin = '(\[\!)(\w*)(.*?)';
end = '(\!\])';
captures =
{ 1 = { name = 'punctuation.modx.nocachesnippet'; };
2 = { name =
'entity.name.tag.modx.snippet.nocache'; };
};
},
{ name = 'meta.tag.inline.modx.link';
begin = '(\[\~)(\w*)';
end = '\~\]';
captures =
{ 1 = { name = 'punctuation.modx.link'; };
2 = { name =
'entity.name.tag.modx.snippet.nocache'; };
};
},
{ name = 'meta.tag.inline.modx.setting';
begin = '(\[\()(\w*)';
end = '(\)\])';
captures =
{ 1 = { name = 'punctuation.modx.setting'; };
2 = { name = 'entity.name.tag.modx.setting'; };
};
},
{ name = 'meta.tag.inline.modx.chunk';
begin = '({{)(\w*)';
end = '(}})';
captures =
{ 1 = { name = 'punctuation.modx.chunk'; };
2 = { name = 'entity.name.tag.modx.chunk'; };
};
},
{ name = 'meta.tag.inline.modx.attribute';
begin = '(\[\*)(\w*)';
end = '(\*\])';
captures =
{ 1 = { name = 'punctuation.modx.attribute'; };
2 = { name = 'entity.name.tag.modx.attribute'; };
};
},
{ name = 'variable.parameter.modx';
match = '(&\w+)=';
},
{ name = 'string.quoted.modx';
begin = '`';
end = '`';
},
{ name = 'invalid.illegal.modx.bad-snippetcall';
match = '(\[[\[\!])(\w+)(\s+)(.+?)([\!\]]\])';
},
);
};
Now my problem is:
There are some Snippet-calls which take parameters:
[[Snippet? ¶meter=`value` ¶meter2=`value2`]]
I tried to define the parameters as variable.parameter.modx and the
values as string.quoted.modx but TM doesn't seem to recognize this.
Also when I write a MODx Tag into a html-string (e.g. <a
href="[(base_url)]">...) TM will ignore it.
Last I tried to highlight invalid snippet calls (e.g. [[Snippet
¶m... (missing ?) or [[Snippet? ¶m='foo' (normal quotation
mark)) but this won't work either.
Can you tell me what I did wrong? :)
Regards
Max Lohrmann
I'd be super-happy if someone could help me with the following
Textmate behaviour.
a. The cursor is in any line that has more characters than the
previous line, like so:
line 1 | ¬
line 2 | 12345¬
When the cursor is at the end (column 6) of line 2 and moved up one
line then it stays in column 6, i.e. behind the ¬ end-of-line marker
of line 1. Like this:
line 1 | ¬ x
line 2 | 12345¬
b. When now return/enter is hit so that a new line gets inserted then
there are also spaces inserted (filling up the place between the end-
of-line marker and the previous place of the cursor) in line 1.
line 1 | ¬
line 2 | ¬
line 3 | 12345¬
Is there any reasoning behind this? It feels really strange to me and
conflicts with several editing habits of mine.
While editing code the insertion of whitespace in line 1 actually
leads to masses of whitespace cluttered all over the place. I can't
imagine that this is intentional. :)
Any hints?
--
sven fuchs fon: +49 (58 45) 98 89 58
artweb design fax: +49 (58 45) 98 89 57
breite straße 65 www: http://www.artweb-design.de
de-29468 bergen mail: svenfuchs(a)artweb-design.de
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
(This isn't specifically a Textmate question, but I know a lot of Textmate
users use Markdown, so I was hoping someone could help.)
How do I name Markdown files so that they are:
1) Recognized automatically by Textmate as Markdown files when you open
them,
2) Indexed automatically by Spotlight,
3) Use a unique extension (like .markdown) rather than a generic .txt
extension?
Right now, if I use the default .markdown extension, the file isn't indexed
by Spotlight. If I save a Markdown file without any extension, it's neither
indexed by Spotlight, nor is it recognized by Textmate as a Markdown file.
A .txt extension is recognized by Textmate and indexed by Spotlight, but I
was hoping to use a different file extension--one that could distinguish
Markdown files from other text files.
How do other people solve this problem?
Thanks,
Tom
**
Okay, I'm trying to keep this one simple and meet my own needs at the
same time. First of all, the insert color command didn't recognize
abbreviated (3 character) RGB color codes. This had 2 drawbacks:
The tab stop inserted by any of the CSS commands, when used in
combination with Insert Color, would add an extra # sign and it
wouldn't properly set the default color when it loaded the color
picker. This revised command is my usual unskilled kludge, but it
recognizes both 3 and 6 character rgb strings, strips the # sign if
unnecessary, and if the resulting hex code is a series of double
repeating characters it will abbreviate (BBAADD becomes BAD). I
wanted to use squeeze to do this in Ruby, but had trouble with colors
like 0000FF, where it would just give back 0F. So I made a mess of
it. It works, but I'd really like to see it cleaned up (I know Haris
could do this in about 4 lines of code). So if anyone has the
time... It'd be great to learn a new algorithm to handle this.
As a side note, I've been using Color Schemer Studio to create
websmart palettes. I can drag directly from the current color
selection into textmate, but it was less convenient than the color
picker. So I've been creating the palettes, and then importing them
into the color picker. That's where this command came from...
Thanks,
Brett
I've become quite a fan of the Rspec BDD framework, and so I whipped
up a bunch of snippets to make my life easier. If anyone wants them,
they're here:
http://blog.amber.org/2006/10/16/textmate-bundle-for-rspec/
Chris
--
| Christopher Petrilli
| petrilli(a)gmail.com
Suppose I am in the html grammar with a php block, like:
<?php
echo 'my insertion point is here';
?>
my expectation is to have ctrl-return produce <br /> rather than the
\n given that I am within the '".
am I wrong on this ?
--
dc
-----
David Clark
Web Specialist
Institute for Community Inclusion (http://www.communityinclusion.org/)
david.clark(a)umb.edu
(617) 287-4318
For a few days now, completion with esc has not been working.
What could be the cause?
Conflict with other modules? or what?
It does not work with ref{} or cite{}.
Any suggestions appreciated.
Christopher Brewster
*****************************************************
Natural Language Processing Group,
Department of Computer Science, University of Sheffield
Awesome, apreciate it Allan.
Very impressed you're on here answering questions. Consider me a an
"offical" textmate user now!
-J
> From: Allan Odgaard <throw-away-1(a)macromates.com>
> Date: October 20, 2006 1:42:15 AM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Executing command on all files in a project AND
> using TM variables in a search and replace
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> On 19. Oct 2006, at 22:12, J Fishwick wrote:
>
>> Command:
>> eval arr=("$TM_SELECTED_FILES")
>> for (( i = 0; i < ${#arr[@]}; i++ )); do
>> perl -pe 'while ($string =~ m/mc\d+(.*\n.*True)/g) {$string =~
>> s/mc\d+/tf$TM_FILENAME/g;}';
>> done
>>
>> Input: Entire Doc
>> Output: Replace selected text
>
> You need to set input/output to none/discard (or show tool tip, or
> maybe show as HTML and make your command output some progress info).
>
> Then your actual command needs to load the file itself, it already
> iterators over the selected files, it just doesn’t tell perl to
> load/overwrite each of them.
>
> So a simple example would instead be:
>
> eval arr=("$TM_SELECTED_FILES")
> for f in "${arr[@]}"; do
> perl -i.bak -pe 's/bar/bar/' "$f"
> done
> rescan_project # do this after you make changes to files, so TM
> will rescan
>
> This will replace foo with bar in all selected files (and create
> a .bak file with the old contents).
>
> Two other things: 1) inside single quoted strings, shell variables
> are not expanded, so if you want to use $TM_… then you need to use
> double quotes, and 2) TM_FILENAME is the filename of the file open
> when you called the file, it won’t update inside the loop. Here you
> would instead use the current file given by the loop (in my example
> $f).
>
On Oct 20, 2006, at 7:43 AM, textmate-request(a)lists.macromates.com
wrote:
> Send textmate mailing list submissions to
> textmate(a)lists.macromates.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.macromates.com/mailman/listinfo/textmate
> or, via email, send a message with subject or body 'help' to
> textmate-request(a)lists.macromates.com
>
> You can reach the person managing the list at
> textmate-owner(a)lists.macromates.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of textmate digest..."
> Today's Topics:
>
> 1. Re: Executing command on all files in a project AND using TM
> variables in a search and replace (Allan Odgaard)
> 2. Re: Latex: completion with esc not working (Christopher
> Brewster)
> 3. Re: TODO problem (Jasper van der Meulen)
>
> From: Allan Odgaard <throw-away-1(a)macromates.com>
> Date: October 20, 2006 1:42:15 AM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Executing command on all files in a project AND
> using TM variables in a search and replace
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> On 19. Oct 2006, at 22:12, J Fishwick wrote:
>
>> Command:
>> eval arr=("$TM_SELECTED_FILES")
>> for (( i = 0; i < ${#arr[@]}; i++ )); do
>> perl -pe 'while ($string =~ m/mc\d+(.*\n.*True)/g) {$string =~
>> s/mc\d+/tf$TM_FILENAME/g;}';
>> done
>>
>> Input: Entire Doc
>> Output: Replace selected text
>
> You need to set input/output to none/discard (or show tool tip, or
> maybe show as HTML and make your command output some progress info).
>
> Then your actual command needs to load the file itself, it already
> iterators over the selected files, it just doesn’t tell perl to
> load/overwrite each of them.
>
> So a simple example would instead be:
>
> eval arr=("$TM_SELECTED_FILES")
> for f in "${arr[@]}"; do
> perl -i.bak -pe 's/bar/bar/' "$f"
> done
> rescan_project # do this after you make changes to files, so TM
> will rescan
>
> This will replace foo with bar in all selected files (and create
> a .bak file with the old contents).
>
> Two other things: 1) inside single quoted strings, shell variables
> are not expanded, so if you want to use $TM_… then you need to use
> double quotes, and 2) TM_FILENAME is the filename of the file open
> when you called the file, it won’t update inside the loop. Here you
> would instead use the current file given by the loop (in my example
> $f).
>
>
>
>
>
>
>
> From: Christopher Brewster <C.Brewster(a)dcs.shef.ac.uk>
> Date: October 20, 2006 6:35:06 AM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Latex: completion with esc not working
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
>
>> On 19 Oct 2006, at 23:13, Charilaos Skiadas wrote:
>>
>>> Is this what they should be?
>>>
>> That looks right. Is this a saved file? Try it with both saved
>> files as well as untitled documents.
>
> The problem is specific to that project I am afraid. There is no
> problem with other latex files in other folders.
>
>> Is it part of a project, via TM_LATEX_MASTER?
>
> yes it is
>> Are you setting TM_LATEX_BIB? (You don't have to, just checking
>> your settings)
>
> Checking this I realised for Bibtex the path had changed. So the
> \cite{} case is solved.
> But the \ref{} case is still not working (in this project).
>
>> How are you testing that it is not working?
>
> for \ref{}
> put cursor in braces and press esc
>
>> Does the other completion command work, the one via opt-esc?
> This does nothing.
>
>> Make sure that you are up to date, I recently fixed a problem
>> someone else had that sounds possibly similar, though his was with
>> the Command Completion command.
> I am up to date.
>
> Thanks,
>
> Christopher
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate(a)lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>
>
>
>
> From: Jasper van der Meulen <jasper(a)logt.nu>
> Date: October 20, 2006 7:43:02 AM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] TODO problem
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> I don't think you understand what i mean...
>
> I've got it in a picture now ..
>
> <screenshot 2.png>
> however
> Regards J.
>
>
> On 20-okt-2006, at 7:26, Allan Odgaard wrote:
>
>> On 20. Oct 2006, at 00:02, Jasper van der Meulen wrote:
>>
>>> Could it be that a project is different for the TODO ?
>>
>> It visits all files found under TM_PROJECT_DIRECTORY (using the
>> globally configured folder reference patterns for what to skip).
>>
>>
>>
>>
>> _____________________________________________________________________
>> _
>> For new threads USE THIS: textmate(a)lists.macromates.com
>> (threading gets destroyed and the universe will collapse if you
>> don't)
>> http://lists.macromates.com/mailman/listinfo/textmate
>
>
> _______________________________________________
> textmate mailing list
> textmate(a)lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate