I'm trying to get what seems like a simple custom coloring rule
working. As a simple test, I just want to set a custom color for all
characters between <code> and </code>.
I added this to the HTML language definition:
{ name = 'markup.code.html';
begin = '<(code)>';
end = '</(code)>';
captures = { 1 = { name = 'entity.name.tag.html'; }; };
patterns = ( { include = '$self'; } );
},
I then went into the Fonts & Colors panel and set a custom color for
the scope markup.code.html, but I don't see any effect.
I read Allan's blog post on scopes and it really seems like the above
should work, but I'm finding a lot of conflicting information on this
topic. The wiki mentions a number of things are out of date so I'm
not sure where the authoritative docs are. The blog? The wiki? If so,
which page?
The full explanation of scope is useful (assuming it's up to date),
but it would be really nice to have some simple, practical examples
just to get started. I believe instant gratification as a strong
motivator for further research. :)
Thanks!
- Scott
> On Feb 22, 2006, at 2:08 AM, Haris wrote:
> You've done amazingly well with the bundle so far. I'm very impressed.
Thanks.
> First of all, why don't you use the find&replace feature of
> TextMate? Then you could record the whole thing as a macro.
You know, I never even thought of that. I'll give it a shot.
Still, I'd like to know how to run a perl search/replace command with
regex in the replace side properly for future reference.
> So maybe a search without ^ and with ([^\n]+) instead of (.+)$
> might do the trick.
tried that, didn't work.
--------------------
I'll try these things and report in the morning on my progress. To
bed now. Thanks again Haris, you are continually my savior.
On Feb 21, 2006, at 5:23 PM, Haris wrote:
> [...] I am not sure what you mean by "piped thru a command" [...]
Sorry, what I meant this that I'm using the search and replace perl
string inside a bundle command.
On Feb 21, 2006, at 2:58 PM, Haris wrote:
> Oliver: One thing you could try, if these things are hierarchical,
> is to have a begin pattern for the first line, and ending in
> something hopefully meaningful.
Here's what i managed to come up with:
begin = '^[A-Z]{2,10}.*[A-Z]*(\s*|\()$';
end = '\.$|\?$|\!$|--$|-$';
...which suits my needs *okay* but not perfectly.
----------
I'm using the following (adapted from Dr. Drang's suggestion):
^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$
for a search and replace string like this one:
s/^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$/\n\n\t{4}$1\n\t{3}$2\n\{2}$3/;
...which makes sense to me, but it doesn't insert those tabs or
newlines when piped thru a command. Clearly I'm missing something
here. As you can no-doubt tell, I'm a complete noob when it comes to
all this programing.
As an example, this:
-----------------
OLIVER
(I want to tell you)
I've got things to say.
Dr. Robert
-----------------
should look like this:
---------------------------
OLIVER
(I want to tell you)
I've got things to say.
Dr. Robert
---------------------------
> If I may suggest, it would be helpful if you add a test screenplay
> in the bundle, so that anyone in the future working on it knows how
> it looks like and what not to break. Like the test.tex we have in
> the LaTeX bundle.
I'll do that.
Hello
I am a professor of mathematics and my essential activity is to
create exercises which I arrange in a structure called "Base"
Often, I work in the following situation:
I create a file "exercise.tex", i put this file in the "Base"
then I create a new file "try.tex" :
\documentclass{myclass}
\begin{document}
\input{exercise.tex}
\end{document}
I do not have enough knowledge on scripts to obtain this:
In Textmate, when i work on an file exercise.tex, i would like wih
one command or script (?)
to compile "try.tex" directly.
I think that a modification of "LATEX & VIEW" should be enough...
With this idea and
with FILE = exercise.tex (the file which I create)
with VAR_FAV_CLASS = myclass
1) modification of FILE in ---> NEWFILE
NEWFILE =
"\documentclass[]{VAR_FAV_CLASS}
\begin{document}
\input{$File}
\end{document}"
2) Compilation of NEWFILE like in "LATEX & VIEW"
Is it possible ?
Would somebody have an idea to build this script?
in LATEX & VIEW, line 35/36 there is
if [ "$TEX" != latexmk.pl ]
then "$TEX" ${TM_LATEX_OPTIONS:=--shell -escape -
interaction=nonstopmode -file-line-error-style} "$1"
I'm not sure but "$1" is perhaps the file I want modify
Thanks
Alain Matthes
I'd like to find and replace a variable inside of a document. How can
I do this? [VAR] Represents the variable:
Find: title="[VAR]"
Replace With: title="dummytext"
Text in Document I want it to affect:
title="Webmaill"
title="Control Panel"
title="Customer Service"
title="Web Hosting"
How can I do this in TextMate?
Also TextMate has no way to upload/browse SFTP/SSH/ or FTP? The price
is way to steep for an application that can't connect and upload the
edited files directly.
Please let me know your thoughts,
Best Regards,
Court Kizer
>> ------------------------
>> ONCE
>> (twice)
>> Three times a lady.
>> Not as much as the Gambler.
>> (This sucks)
>> How would you know?
>> ------------------------
>>
>> How do I match the 2nd line but not the 5th?
>> How do I match the 6th, but not he 3rd?
>
> What is different in each case? The presence of ONCE exactly in the
> line before?
>
> Indeed, I'm uncertain what the logic behind the matches is supposed
> to be. Is the second line matched because of the sequence of cardinal
> numbers, a parenthetical following a line of all capital letters, a
> parenthetical with only one word, a parenthetical with no capitalized
> letters, a parenthetical followed by a statement... and so on.
Yeah, sorry.
Matching the 2nd line (but not the 5th): I want to match any line
that begins and ends with a parenthetical ... ^\(.*\)$ ... but only
when the line is directly preceded by a line of all capitol letters,
Matching the 6th (but not the 3rd): Actually, I got this one
backwards. I want to match the 3rd but not the 6th. So... Any line
that is directly preceded by the match I described above.
----
I'll check out the IRC channel.
> [1] http://www.geocities.jp/kosako3/oniguruma/
I'll check it out.
Hi,
I already know that it is not possible by default to have a different
tab and indention size.
I'm new to TxMt so I want to ask if this is possible to achieve via
scripts / bundles ?
One example to show my need. I'm working in a Python projekt, where
the interpreter handles one tab as 8 chars. We use an indention of 4
chars.
My workaround at the moment: set Tabs to 8 convert all tabs to spaces
the set tabs to 4 soft spaces.
If somebody has hints, I'll work on it for myself.
Thx Jonatan
Hi,
It would be helpful if the language bundle editor had a pop-up hierarchical
menu of the standard name
Something like:
keyword
meta
string
support
variable -> other.
storage parameter.
string
So when writing a language syntax, and looking for names, you can just have
the insertion point in the right location, click on the pop up to see what
is appropriate, then either it inserts when you release the menu, or there
is an insert button beside it.
tim
____________________
---
"Of what use is a philosopher who doesn't hurt anybody's feelings?"
--Diogenes of Sinope, Herakleitos and Diogenes pt. 2, Fragment 10 (tr. by
Guy Davenport, 1976)
I don't know where else to turn for help with regex, so I turn to
you. Consider the following:
------------------------
ONCE
(twice)
Three times a lady.
Not as much as the Gambler.
(This sucks)
How would you know?
------------------------
How do I match the 2nd line but not the 5th?
How do I match the 6th, but not he 3rd?
Is this possible?
P.S. Do you guys have any really good references for regex (aside
from the manuel), where I can hunt down problems like this?