I modded my Textmate Javascript bundle today to treat 'true' and 'false'
different to the other constants.
http://vennt.net/tempting/intelibool.png
So now true gets a green highlight and false a red one so you can read if
statements at a glance etc
Here are the lines I modified
{ name = 'constant.language.js';
match = '\b(false|null|super|this|true)\b';
},
was replaced with
{ name = 'constant.language.js';
match = '\b(null|super|this)\b';
},
{ name = 'constant.language.js.true';
match = '\b(true)\b';
},
{ name = 'constant.language.js.false';
match = '\b(false)\b';
},
Then I just added rules to my current theme for
"constant.language.js.true" and "constant.language.js.false"
I would have done it Textmate wide but I don't know enough about the
system for that, is there any implications for what I have done here?
I'm experimenting with a way to generate id/class names from the
selected text when I trigger one of my headline commands. I really
like the way this turned out and thought I would share it. Unless
someone comes back and asks me to make changes, I promise I'll stop
now. I prefer camel case in CSS files, but I've been known to be
inconsistent. I made commands to switch between the two as well. I
apologize to anyone who is currently rolling their eyes ;->.
I'm attaching the command for an h1 tag with a shortcut key of
command-1 that will take selected text or the whole line and turn it
into a headline. It removes leading spaces and tabs and there's a
camel case version and an underscore version. On a long headline the
id name gets ridiculous, so there's a command that will work on both
to shorten it to the first three words. And lastly, in case you
can't make up your mind either, or need to correct your own
inconsistency like I do, there's a convert command that will switch
back and forth. The shorten and convert commands are set to
command-! (exclamation point). I also used an h1 tab trigger on the
h1 commands which you may want to remove if you keep the original h1
snippets. If used with the tab trigger, they behave just like the
old snippets, except they'll mirror and transform the text you type
between the tags.
Enough rambling.
Brett
I'm wondering why when editing an email message (using the Mail language) the scope is set to:
text.mail.markdown
text.html.markdown
This results in html-style commands and snippets being executed (comments command inserts <! -- -- > style). It seems like Text should be the inherited scope, with modifications ( > set as the comment mark).
Which begs another question: how to import the Text language bundle into the Mail bundle. (So that I can have plain text scopes and thus syntax coloring).
Thanks!
Q
On Thu, 26 Oct 2006 12:19:22, romain.guerout(a)stud.unibas.ch wrote:
> William Uther <willu.mailingLists@...> writes:
>
>>
>> Hi all,
>>
>> I just finished some scripts that allow remote editing with
>> TextMate, kinda like BBedit's sftp functionality. They're a little
>> rough, but I thought I'd release them so that others can play if they
>> want.
>>
>> http://www.cse.unsw.edu.au/~willu/RemoteEdit/
>>
>> Cheers,
>>
>> Will :-}
>
>
> It silently fails for me :-(. I type “mate file†on the
> remote
> machine, it asks for my password on the Mac, keeping an eye
> on my net traffic, I see that the remote file is copied on my Mac
> but nothing happens…
> Is it possible to have more debugging outputs of some sort…
>
> TIA
I'll have a look this weekend. Most of it is pretty simple though -
you could probably add that debugging yourself if you know any shell
script at all. Here's a description of what is going on.
The 'mate' script runs on the remote machine. It is a simple shell
script that ssh's into your mac and runs the 'remoteOpen' script with
the username on the remote machine, the hostname of the remote
machine and the path to the file.
The 'remoteOpen' script scp's the file to the local machine. Given
that this is happening, you know this is being called with correct
arguments. Once it has scp'd the file across, this script calls
'odbedit' on the local file (with '-s remoteOnEdit' arguments which
tells odbedit to call the 'remoteOnEdit' script when the file is
edited. That script just scp's the file back to the remote machine).
I'm guessing this call to odbedit is what is failing. odbedit is not
a script, but is has pretty good debugging output on errors. I
suggest opening a shell on your mac, creating a text file, and
running 'odbedit file' locally to see what happens. The file should
open in TextMate, and odbedit should block. When you close the file
in TextMate, odbedit should unblock and exit.
In more detail, odbedit will send an AppleEvent to ODBForwarder.app
which will forward the AppleEvent to TextMate. When Textmate saves
or closes the file, it will send an AppleEvent back along the same
path. In order for odbedit to find ODBForwarder.app, you need to
have shown the finder where ODBForwarder.app is - open the directory
containing ODBForwarder.app in the finder.
odbedit will give errors to the stdout in the shell you ran it on.
You can see the debugging output for ODBForwarder.app by running /
Applications/Utilities/Console.app . ODBForwarder.app will display a
message there when it starts up, and will display any errors there.
I can imagine two possible errors here:
i) ODBForwarder.app cannot be found or started for some reason. In
this case I would expect to see an error message from odbedit, and
you should not see the startup message from ODBForwarder.app on the
console.
ii) ODBForwarder.app cannot find its preferences file. In this
case it will default to sending its events to BBedit, which you
probably don't have installed :). This should show up as error
messages on the console. For more info on ODBForwarder.app and its
preferences, see http://www.cse.unsw.edu.au/~willu/ODBSuite/
#ODBForwarder
iii) ODBForwarder.app has found its preferences and is sending to
TextMate, but for some reason the events are not getting through.
This should also show up as error messages on the console.
I'm not sure if the error messages are detailed enough to tell the
difference between ii) and iii) by default. Have a look and see what
you get.
Hope that helps. Let me know what happens :)
Will :-}
im getting an error of no files to commit from the svn status window
when clearly there are things to commit by clicking the diff button of
the files above, this is on the latest rev, can anyone else see this ??
Kim
A little quirk with the Latex equation highlighting: if you use an
equation environment like \begin{equation} or \begin{multline},
everything inside of the \begin \end is highlighted as an equation, even
\label{} definitions. Shouldn't things like \label not be colored like
the equation? What do you all thing?
Will
Here's what I'm doing with the repeating tab stops, using </ul> as
the tab trigger. I end up creating one of these on every site I
design, so this will make things easier. They all follow the same
format, and if there are multiple lists, they just change ids. I
have not yet accounted for nested or dropdown menus.
Brett
-----------------------------------------------
Create Navbar:
-----------------------------------------------
<ul id="${1:navbar}"}>
<li class="${2/[[:alpha:]]+|( )/(?1:_:\L$0)/g}"><a href="${3:#}">$2</
a></li>
</ul>$0
Tab Trigger: Navbar
-----------------------------------------------
Create Navbar Menu Item:
-----------------------------------------------
<li class="${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}"><a href="${2:#}">$1</
a></li>
</ul>$0
Tab Trigger: </ul>