I tried to google but didn't really find anything in my oh so short
overview.
It would be great to have a meta-selector of sorts for the scope, so
you can "highlight" the current element when editing or something.
I'm actually beginning to really like the Brilliance Dull Beta theme
(!) and that html-tags are almost "invisible". However, it would be
really cool if it could light up when the caret is over it, or light
up an attribute with the caret on and so forth.
This must have been mentioned before, but as I said, I did google ...
a bit :)
Andreas
I use this to create the feeds for ollieman.net. I thought you guys
might like this...
You'll want to start out with a valid RSS2 feed like this:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title></title>
<link></link>
<language>en-us</language>
<description></description>
</channel>
</rss>
Now to the real fun; it's just a snippet but it makes hand-coding RSS
feeds a breeze. Here it is:
<item>
<title>$1</title>
<description><![CDATA[
$2
<a href="$5">Read more</a>
]]></description>
<pubDate>${3:`date +%a,\ %d\ %b\ %Y\ %H:%M:%S\ %Z`}</pubDate>
<author>${4:Oliver Taylor} nospam(a)example.com</author>
<guid isPermaLink="true">${5:http://ollieman.net/$6}</guid>
<link>$5</link>
<category>$7</category>
</item>
The only thing of real note here is getting the pubDate correct. If
you want it to insert GMT instead of your local time you'll have to
tweak that.
Lastly, make sure to set the scope to text.xml and you're all set.
That's it! 1,2,3-easy RSS feed.
Dear TMaters,
I am experiencing weird problems with TextMate not recognizing some
keyboard shortcuts from bundles (i.e. the LaTeX bundle) containing
the escape-key. I can get the completion when pressing esc - but all
the other commands working with esc and a modifier key do not work at
all. If I am lucky I get a beep; selecting the macros I need by hand
from the bundle-macro-menu works as intended… any ideas?
Also I cannot get the "Edit in Textmate"-InputManager to work in
Mail.app - it works e.g. in TextMate's Bundle-Editor (very useful),
but Mail.app would be even more so. ;(
Any idea where I might look for causes to this problem?
* there are no other InputManagers installed
* my .services are rather trimmed by using ServiceScrubber - and as
far as I can tell none are colliding on the shortcuts…
Thanx again,
Daniel
Haris,
thank you for your hint, this solved the probelm I guess. I have not
been using \ref since I am using a mixture of \vref and \prettyref
instead - which both did not have a scope of "meta.label.reference".
I just recently added those commands to the grammar and now it works
fine with alt-esc. The "old" completion gives me the following output
on console.log:
> Mar 26 01:45:47 dekayBase crashdump[724]: bash crashed
> Mar 26 01:45:47 dekayBase crashdump[724]: crash report written to: /
> Users/dekay/Library/Logs/CrashReporter/bash.crash.log
and within TextMate I get:
47:68: execution error: System Events got an error: Die Liste ist
leer. (2)
I am using a svn checkout of the bundle -
> e181090182:/Library/Application Support/TextMate dekay$ ls
> Bundles Conventions.txt LICENSE Themes Tools
Dan
Haris,
As you are the "local LaTeX bundle god." Do you think functionality
like what I am trying to do would be useful in the main bundle? I
have been thinking about doing some bundle or snippets for language
grammar extension specifically targeted to LaTeX, as this is my main
concern these days (or better call it major distraction from actually
*writing* my thesis).
What I am trying o accomplish is a much more detailed markup/
assignemnt of scopes for possible theme development. I believe it
would be very useful to have that much more markup available,
especially since I am using many packages, environments -- just
getting some visual feedback would be nice. Or something where you
are editing some lines somewhere and you are wondering which
environment you are currently in, just press ctrl-shift-P and it
prints "meta.environment.myverycoolenv" -- much better would be a
very light color change in that environment. (I like to have my list
environments colored… and possibly with different colors for itemize,
enumerate etc.)
And these thoughts brought me to the point where I figured I could
create that "detour" to include my custom language grammar before the
LaTeX language grammar was read.
Examples for my changes are:
- recognize \vref and \prettyref as meta.label.reference
- markup the different \headings with
support.function.section.XXX.latex with XXX being part, chapter,
section etc.
- markup the acronym package
- markup the fixme package so the \fixme{} is easy to spot.
Many of these changes are not essential and mostly eye candy. But
then: I like eye candy ;) Marking up commands that are not standard
TeX or LaTeX does have other benefits - if you have a different color
for recognized commands vs. words that start with \ - you kind of get
spell checking built in for commands ;) i.e. "no special color? Not
spelled correctly"
I am still not very comfortable with the whole language grammar
setup, but I am learning… a bit awkward is also the naming convention
- as I need a better understanding of the underlying logic in order
to apply stuff to latex. But in the end - it is just markup and as
long as there is some convention you can easily use the markup - but
names are names and if i call something text.latex or humftibunm
makes no difference to the machine -- just convenience for us users. ;)
A couple questions still bog my mind, though:
- Am I correct assuming that I can use a certain pattern just once?
When I copy a rule from Latex.plist to my custom.plist - only the one
encountered first gets to markup the text.
- Is there a way to markup a pattern with more than just one scopes?
Like for \begin{mycustomlist} set something like
meta.environment.list *and* meta.package.custom
Good night ;)
Dan
Dear TMaters,
Is there a way to parse an external file, say within my project, and
possibly defined by a project environment variable - to add certain
terms to my Language Grammar? This would be very useful for LaTeX
projects where you have different custom macros and/or different used
packages where you want some hi-lighting in your theme and thus have
to change the grammar file for all those changes. Better would be a
macro/script/whatever that would just scan the preamble.tex or so for
all my \newcommands and add them to the recognized scopes...
Or, less fun but still useful: one could write a file with certain
terms that need a new scope - and parse that from within the bundle.
I guess maybe this is overkill, but it seems to me that LaTeX is one
of the more customizable languages out there - and I at least would
love some more power-tools and flexibility on my fingertips *without*
running to write new regexp's every time (but then I am not familiar
enough with regexps to do so easily - maybe that will need to change).
What exactly IS the most useful way and best way in regards to
updating "official" bundles via svn to make customized bundles? How
can I make sure that I can still take advantages of "official"
changes that come via svn but still retain my customizations? (And
possibly be informed if there are conflicts - i.e. if there are
changes in a bundle where I have changes as well…?).
…Dan
Hi all,
Using TextMate and love using it in my current (Python) project.
I have a question though. I svn co-ed the
RegularExpressions.tmbundle, and installed it. Now is there a way to
get this to play nicely with Python?
Let me explain: In Python most regular expressions are defined as
follows:
blah = re.compile(r'...')
would compile the regular expression ... into blah object.
Now I would like the (regular expression code) inside the r'...' to
be colored with RegularExpressions.tmbundle. I think I can do this
somehow with scopes, but this is still my first week with TextMate,
and I don't know what I'm doing with it yet.
Thanks for the help!,
_Ryan Wilcox
Dear folks,
I have succeeded, a bit at least. I have been looking for a way to do
two things:
1. create markup for the different heading types
2. create some kind of mechanism that lets me extend the latex
grammar without the need to fiddle with the main latex grammar file
(as I would like to keep my edits separate from those within the svn/
official version).
The following is just quick description, I will clarify later if
there are questions… for now. And I will post some samples somewhere
if anyone cares.
solution for #2:
start the LaTeX language grammar with:
patterns = (
{ include = 'text.latex.user'; },
and define overriding patterns as well as new, custom patterns such
as stuff you would like for packages you use or macros you defined
yourself (useful since right now everything starting with \ is
colored, but in order to catch typos or whatever I like to have my
custom commands colored in a certain way - thus recognizing them
easier.)
solution for #1:
add those lines (adapted to each heading that should be styled
separately) before the main section recognition pattern:
{ name = 'meta.section.latex';
begin = '((\\(?:chapter))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
end = '(\})';
captures = { 1 = { name =
'support.function.section.chapter.latex'; }; };
patterns = ( { include = 'source.tex'; } );
contentName = 'entity.name.section';
},
further notes:
the includes may need to be adapted in the examples in order to
correctly parse things in bracket within your custom definitions.
Lessons learned:
* You should not create a circular include structure. This will crash
TextMate
* and thus: save early and save often. Just when does TextMate save
edited bundles? (I just quit TM, this does the job, but else? i.e.
after that crash I lost the work of about 2h ;))
Dan
Dear folks,
I would like to get some language grammar markup to the different
levels of headings in my Latex stuff - and thus I am trying to mess
with the grammar file. I have added rules like:
{ name = 'meta.section.level0.latex';
begin = '((\\(?:part))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
end = '(\})';
},
which seem to work - but I am losing the functionality of the
"regular" Latex grammar. So I am trying to nest the recognition
somehow, resulting in:
{ name = 'meta.section.latex';
comment = 'this works OK with all kinds of crazy stuff as long as
section is one line';
begin = '((\\(?:(?:sub)*section|chapter|paragraph|part|addpart|
addchap|addsec|minisec))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
end = '(\})';
captures = { 1 =
{ name = 'support.function.section.latex';
patterns = (
{ include = '#levelA'; },
);
};
};
patterns = ( { include = 'source.tex'; } );
contentName = 'entity.name.section';
repository =
{ levelA =
{ name = 'meta.section.level0.latex';
match = '((\\(section))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
};
};
},
but somehow this does not work. Any ideas what needs to be changed?
thanx,
Daniel