I have just discovered TextMate, and am so far very happy with it,
but I think I just hit a glitch...
I am trying to edit a SQL load file that is about 5M, which shouldn't
be a problem. However, some of the lines are very long, as a complete
website contents is in a single line. I have no idea how many
characters are in this line, but I suspect about 2M worth.
Anyway, TextMate hangs while trying to work with this file. I can't
do much at all. Even a simple act of scrolling hangs. TextEdit does a
reasonably good job with the file though...
Actually, I don't think it is hanging, as it eventually responds
(about 30 seconds later), but it is so slow that it is completely
unusable. Is this a known problem? For me, it is weird files like
this that we need an editor like TextMate to be able to easily handle.
Thanks...
Jim Leask
Hi!
I'm just working on some Tex-Document which uses several dialogues
which I want to enclose in "< "> (the result are those <<
>>-enclosures in the document). Would be cool if that could be added
to the language grammar.
Thanks in advance
Niels
Hi Allan and friends,
I have a source tree structure like this:
www/
site/
index.tcl, .adp
one.tcl, .adp
edit.tcl, .adp
item/
index.tcl, .adp
one.tcl, .adp
edit.tcl, .adp
The fact that files are named the same, but in different directories:
- Confuses both the Cmd-Opt-Up "Go to Header/Source" feature, which
will gladly find www/item/one.adp when I'm editing www/site/one.tcl. It
would be good if it would prefer the file in the current directory when
one exists. Otherwise, it's a great feature.
- Similarly, when using Cmd-T "Go to file", which I use almost
exclusively to open up new files now, it would be great if I could
write "itemonetcl" to get item/one.tcl, as opposed to site/one.tcl.
Currently, it doesn't take the path into account at all.
I can see some downsides to changing current behavior, too,
particularly with the Go to file feature.
But let me know what you think.
/Lars
As I set up Reformat Comment commands for the languages I use most
frequently (LaTeX and R), it occurred to me that maybe there's a way
to make a single call to rubywrap more generic, so that we don't need
a command per bundle. This is the result:
#!/usr/bin/env ruby
$LOAD_PATH << "#{ENV["TM_SUPPORT_PATH"]}/lib"
require "escape"
scope = ENV["TM_SCOPE"]
case scope
when /comment\.(block|line)\.number-sign\./
cstring = "# "
when /comment\.(block|line)\.percentage\./
cstring = "% "
end
flags = ""
flags += " -p \"#{cstring}\" "
flags += " --retabify" if ENV["TM_SOFT_TABS"] == "NO"
text =`echo -n "#{e_as(STDIN.read).gsub(/[$`]/, '\\\\\0')}" | ruby "#
{ENV["TM_SUPPORT_PATH"]}/bin/rubywrap.rb" #{flags}`
print e_sn(text)
The parameters are the same as the current command, with the
exception of scope, which I set to "comment.line, comment.block".
I also added a gsub to the command because it was eating latex math
and R symbols ($). There's probably a better solution to that. This
seems to work for me, and should be extended easily by adding lines
to the case statement for other languages. One advantage is that by
specifying the comment character based on the scope, it ought to work
for anything; it catches comments for both bash and perl, for
instance, without any extra effort. I think it's kind of cool.
-Alan
Hello,
I am working a lot with source code written using Emacs on Linux. The
prevailing convention is that tabs are presented as 8 spaces, but
indents are only 4 spaces. Indenting will insert spaces, and Emacs
seems to swap groups of 8 spaces for a tab.
If I use a tab size of 8 in Textmate, the source files display
correctly. Sadly, there is no way to tell Textmate to use an indent
size of 4.
It would be very useful is it was possible to tell TextMate to:
1. Draw tabs as 8 spaces
2. Use spaces when indenting
3. Intend with 4 spaces, not the 8 spaces from a tab
Is there any way to do this with TextMate at the moment?
I'm using TextMate 1.5.3 (1215)
--
Kind regards,
James Milne
Hi,
Mail has this thing where by when you are typing and you are not sure
of the spelling of the word (or even if such a word exists) you
can press <esc> before yo complete the word & it gives you a pull
down of various choices. Is this something that can be incorporated
in the text scope of textmate?
(note: i know of ctr-apple-D which can check for the word in
dictionary but that is not the functionality I need in this case -
ie, since that assumes you already know how to spell the word...)
Thanks
danstan
ps; interestingly the Mail functionality doesnt seem to work within
a sentence.
Hi,
I've stumbled on a problem with TextMate's python handling which goes
into an infinite loop (or a really long computation) during certain
circumstances. When this happens, TextMate doesn't react to any input
anymore, which causes dataloss of everything typed after the last save.
I have the following function (<> only shows the position of the
caret and is no text) in a python file:
def c(docstring, baseindent=0):
#from http://www.python.org/dev/peps/pep-0257/
lines = docstring.splitlines()
# Determine minimum indentation (first line doesn't count):
indent = sys.maxint
for line in lines[1:]:
stripped = line.lstrip()
if stripped:
indent = min(indent, len(line) - len(stripped))
# Remove indentation (first line is special):
trimmed = [<>lines[0].strip()]
if indent < sys.maxint:
indent -= baseindent
for line in lines[1:]:
trimmed.append(line[indent:].rstrip())
# Return a single string:
return '\n'.join(trimmed)
Now I type ]<enter> and watch TextMate die. It'd be cool if this
could be fixed.
To reproduce the problem:
1. Open TextMate
2. Paste the above function into TextMate, put your caret where <> is
(and remove <> from the text)
3. Go into python mode (shift-ctrl-opt-p 4)
4. enter ]<cr>
Bye,
Nico
I must be missing something really obvious here but I don't know how
to do this most basic thing:
(1) Drag a folder onto TM icon to open as project
(2) Open an HTML file called index.html
-- Now here's the part that throws me ---
(3) Make a new file called index2.html based on the original index.html
My first instinct is to right click on the file in the project drawer
and look for "duplicate file" or something similar - no such option
exists. So the next thing I try is opening the file and using "Save
as" to make the new file. This actually works but something weird
happens: In the drawer, it has the effect of *renaming* my original
file rather than adding a new one. If I switch to another
application and then back to TM, the original file reappears. Is
this expected behavior?
So what's the preferred method of creating a new file starting with a
copy of an existing one?
Thanks!
Sean
:::: DataFly.Net ::::
Complete Web Services
http://www.datafly.net
Hello
When I choose from the bundle Latex > Edit Configuration File
The in TextMate opening file is rather confusing. When I open this file
in Proprety List Editor ists clear, but in TextMate its rather cryptic ...
Is there something wring with my configuration, or is that normal. Also
I dont know, how to actually use this file.
Thanks
David
The macro described here has a few oddities.
http://comox.textdrive.com/pipermail/textmate/2005-October/006444.html
<quote>
1) move to beginning of line (ctrl A)
2) regexp search for: (?=\S|$)
</quote>
Lets say '#' indicates where the cursor is.
When I press Home on the following line..
@implementation App#Controller
Then the cursor is placed between '@' and 'i'.
When I press Home on the following line..
x -(IBAction)te#st:(id)sender {
Then the cursor is placed just before '-'.
Pressing home on an empty line then the cursor is
placed on the following line.
Is there a better smart-home macro?
preferable a smart-home macro that can toggle
between line-begin and text-begin.
--
Simon Strandgaard
http://opcoders.com/
I've tried to make the citation and bibliography commands detect
where your installation is, so that you shouldn't have to set any
environment variables for those any more. So once again, those brave
among you and with no paper deadlines, please remove any special PATH
specifications that you had made just for LaTeX TM (likely based on
previous recommendations by me), and let me know if the commands
still work for you, and if not then also where, to the best of your
knowledge, your tex binaries are. (Probably doing: "which kpsewhich"
from the terminal should give that to you.
Thank you all again for your patience in this transitive period.
Haris
I am having a problem with the GTDAlt date picker. The date inserted
does not correspond to the date entered. So entering 12/03/2007 gives
me 2007-03-11. And entering 31/05/2007 gives me 2007-05-29.
While on the topic of the date picker a small issue about the UI.
Dates are entered day month year. I think it should be year month day
for two reasons:
1. That way it is consistent with what is entered in the file.
2. The date picker defaults to the current date which is now
February. Helpfully it doesn't allow you to pick a day not in that
month. So to enter in 31/05/2007 I first had to tab ahead to change
the month before entering the day (since there are not 31 days in
February). The year month day format would avoid this problem.
Thanks.
All the best, Mark
_________________
Mark Eli Kalderon
Department of Philosophy
University College London
Gower Street
London WC1E 6BT
Departmental webpage: http://www.ucl.ac.uk/philosophy
Personal webpage: http://markelikalderon.com
Hi there
I have a non-public Wordpress blog behind a htpasswd
authentification. Is it someway possible to use the blogging bundle
all the same? When trying to fetch the posts, I get the following
errors:
/usr/lib/ruby/1.8/xmlrpc/client.rb:533:in `do_rpc': Authorization
failed. (RuntimeError)
HTTP-Error: 401 Authorization Required from /usr/lib/ruby/1.8/xmlrpc/
client.rb:409:in `call2'
from /usr/lib/ruby/1.8/xmlrpc/client.rb:399:in `call'
from /Library/Application Support/TextMate/Bundles/Blogging.tmbundle/
Support/lib/metaweblog.rb:31:in `getRecentPosts'
from /Library/Application Support/TextMate/Bundles/Blogging.tmbundle/
Support/lib/blogging.rb:547:in `fetch'
from /Library/Application Support/TextMate/Bundles/Blogging.tmbundle/
Support/lib/blogging.rb:546:in `popen'
from /Library/Application Support/TextMate/Support/lib/progress.rb:
11:in `call_with_progress'
from /Library/Application Support/TextMate/Bundles/Blogging.tmbundle/
Support/lib/blogging.rb:546:in `fetch'
from /tmp/temp_textmate.V9d44n:3
Thanks for any help in advance!
Oliver
TextMate has a syntax element called "Embedded Source", which is used
for things like the lstlisting environment in LaTeX or JavaScript
code embedded in HTML. The default background color for this element
is a light blue, which is almost identical to the light blue used for
selected text. Because of the similarity, I always get confused and
think I've inadvertently selected some embedded source. I'm wondering
why there is such a similarity between these colors. Was it
deliberate (and if so, what was the reason?) or was this an oversight?
Trevor
Hello:)
1) I know that my use of Latex is different from the majorities of
the users because I create especially packages. I need to have a
really different completion. I need for example :
newcommand
renewcommand
RequirePackage
newcounter
setcounter
stepcounter
newlength
etc..
for xkeyval
define@cmdkey
define@boolkey
presetkeys....
for ifthen
ifthenelsee etc....
etc...
I would like to know the good way to obtain this
Is it necessary that I modify LateXCommandCompletions.rb ?
2) But I do not understand why in the LateXCommandCompletions.rb,
there are words like pi, Pi, lim etc ... words with 2 or 3 letters ?
Which is the interest to complement these words?
greetints alain
I don't know if I'm using TextMate in a strange way, but: I have an HTML
blogging project open with a couple of root folders, and each of those
folders have one sub-folder for archive purposes. Every now and then I like
to archive posts from the main folder into the sub-folder, but when I do
this the sub-folder unfurls - and I really don't want this to happen. Is
there any way to stop it? A preference I can check somewhere? Why does it
open in the first place; is this behavior useful to some other workflow or
language?
Thanks for any thoughts
- david
I just updated to the latest cutting edge version, and updated my
bundles. I wanted to try the Ruby auto complete, but either I'm doing
something wrong, or it just doesn't work.
No matter what I try to type, all I get is a tooltip saying "No
matches were found". In a Ruby/Rails document, I start typing
'validates' (without the quotes, obviously) and hit Option Escape and
get No Matches were found.
Is there something else I need to do to get this working?
Thanks,
John
A little command that's especially useful for writing emails.
It takes a highlighted URI and uses murl.info to shorten it to
something more like:
http://murl.info/14511
Very tinyurl but a little more underground ;-). Plus I couldn't get
tinyurl to do this...
It will accept a uri with or without a protocol (http(s)) and will
accept just about any amount of garbage on the end. It does a pretty
decent job of recognizing if what you have selected is actually a uri
or not.
Brett

Brett Terpstra : Art Director
Circle Six Design, Inc.
111 Riverfront Dr, Suite 204
..................................................
p: 507.459.4398
877.858.4332
f: 1.866.540.3063
e: brett(a)circlesixdesign.com
http://www.circlesixdesign.com
..................................................
On Feb 27, 2007, at 9:14 AM, Allan Odgaard wrote:
> Could you btw make a case for the new Ruby syntax? I never figured
> out what problem it was supposed to solve.
The default Ruby syntax doesn't scope enough stuff.
There are very basic things that are completely missing like
method calls, operators and lambda variables.
My Ruby Experimental adds these basic things and a few other niceties
like leading space and core library method names and better
punctuation support.
The advantage is partly for the ability to better theme Ruby files,
which many people like myself are looking at all day every day.
Looking at mostly white on black text all day is enough to make you
go mad.
Another advantage is in using the Select Scope command to better and
more quickly select the current relevant scope.
When you don't know the language as well as you'd like, having the
core library methods colored slightly differently can really help you
to quickly notice any misspellings and such.
So, to sum up:
finish scoping the basic syntax of the language
different kinds of operators, methods, lambda variables, basic
punctuation like the => thing, etc…
core methods
Improved text interaction with select scope
improved readability with leading space scopes
improved awesomeness with the minimization of unscoped generic text
But, that's not really the point.
The point is that a syntax should scope as much as possible, not as
little as necessary.
Then it's up to each person to choose how you use those scopes.
Just take a bit of a peek for yourselves internet people!
Would you rather spend all day looking at this:
http://flickr.com/photo_zoom.gne?
id=404629435&context=photostream&size=o
or this?
http://flickr.com/photo_zoom.gne?
id=404629540&context=photostream&size=o
(if you hate that theme, just pretend you love it instead)
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
would it be possible, to add folding markers for the =begin ... =end
documentation in ruby? It would be usefull, if I could hide large
documentation parts in a script.
Thanks in advance,
Simon
- ----
> privacy is necessary
> using http://gnupg.org
> public key id: 0x6115F804EFB33229 http://ruderich.com/
simonruderich.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFbE+cYRX4BO+zMikRCuQjAJ4nyg7vJVGgfILRNGspMScVw5B10wCbBfwf
Seck//9uFxjZzVv+IJXGRIg=
=4TGS
-----END PGP SIGNATURE-----
Hi. My Textmate bundle has disappeared - it doesn't show in the Bundles
menu. I've downloaded it via GetBundle and Subversion, but it still
doesn't show.
Now, maybe it never shows in that menu. I don't really remember it. But
what I do know is that the keyboard shortcut for 'show current scope'
doesn't work any more, and I can't find the command anywhere. That
leads me to think that it's in the Textmate bundle, and that the bundle
is AWOL.
Can anyone give me any advice?
Bruno
I have a new bundle I have written for N3/Turtle. I saw a request in
for RDF so I suspect there is a fellow semantic webster out here
somewhere. I have pretty good syntax highlighting although it is
pretty much the turtle subset of N3 right now...re:
http://www.dajobe.org/2004/01/turtle/
I was pretty unsatisfied with the only emacs mode out there:
http://larve.net/people/hugo/2003/scratchpad/NotationThreeEmacsMode.html
And have recently started using Textmate, and started working on this
bundle.
This bundle also has the ability to become the basis for a SPARQL
bundle as that is also based on the N3 syntax.
Anyway, the bundle is useful to me and without people requesting fixes
it will never get better. You know, I'll fix anything that doesn't
fit my coding style but that won't take long.
Main feature: I highlight subject, predicate and object (also literal
vs iri objects) rather than uri vs qname color.
Anyway, just looking for anyone else interested in N3 or any bundle
dev advice in general as this is a new platform for me after a long
emacs relationship.
--
ciao,
Phil
Hi. I've started having a problem with the TODO bundle, where 'Show
TODO list' never completes - it just keeps processing. I assume that
there's some kind of infinite loop in the regex search, but I have no
idea how to find it. I stripped away the list of options (FIXME,
CHANGED etc) but it hangs on all of them. Can anyone offer any advice?
Bruno
Hi,
How can I switch from the big text editing area back to the drawer
without using the mouse so that I can choose a new file? In case it
matters I am using the missing drawer plugin so that the drawer is
always on the left when I open a project.
Thanks,
Peter
Hi
I don't know if is Charilaos the LaTeX/Bibtex maintainer, but,
anyway, probably everybody in the list knows the answer:
Is there any support for Bibtex appart from the Language definition?
In the support I mean bibtex .bib tools like snippets for items, like:
@book($1,
author = "$2",
title = "$3",
publisher = "$4",
series = "$5",
year = $6,
)
$0
tidying the formats, etc.
I know there is an insertion of citing in LaTeX mode, but I can't
make it run for me. I don't know well how to invoke it, when (must
the .aux be there?), how to indicate the bibliography files (since it
seems not to look for the \bibliography command in the LaTeX source),
etc.
Any help will be welcome. Thanks.
Juan Falgueras
Hi,
did I missed something or does textmate not support split views?
I need to apply certain changes to two source files based on another
similar source
file, I already edited.
Regards,
Stefan
Hey folks.
I recently updated my Ruby and Rails bundle (R6637 and R6633 respectively)
and have found that some of the bundle function appears to be gone. For
example the def, deft, and defs tab completion features. Is this on
purpose?
James H
i ment to ask this last week but i just rolled back to 6623,
i no longer get function completion with rev 6667, has anyone had this
problem and solved it.
Kim
Hi,
After much deliberation I decided to switch from Emacs to Textmate
yesterday, despite being wary about some important keybindings not
being supported.
I've managed to map almost everything the way I like it, but the most
important is still not supported, and that is ctrl-space and ctrl-w for
setMark and deleteToMark, respectively.
After searching the mailing list and blog archives I am left with the
impression that this has been on the todo list for several years. I was
just wondering if there is an ETA on this functionality? And out of curiosity,
is it very difficult to add, or just very low on the (long) todo list?
I'm asking because I fear I will have to unlearn the very efficient Emacs
way (to me, anyway) while I wait for this to be supported in TM. And that
would be a shame :)
In most other aspects, TM is fantastic. And the better I understand it,
the more impressed I get. Great editor!
--
Best regards,
Stian Grytøyr
When we get the new scope injection system for syntaxes we should
plan on making some big changes to the current state of many bundles.
We currently have a Ruby syntax, and the Rails syntax includes it.
The current Rails syntax seems to be targeted at Rails 1.1.x.
I'm torn about upgrading that syntax however.
On the one hand, the official Rails syntax should support the latest
version of Rails, but I'd hate to introduce some incompatibilities
with current applications written for Rails 1.1.x.
The new organizational method should be something like this.
Root language syntax
Contains only the basic scopes for the language syntax itself and
any built in language stuff.
Core library syntax injector
Injects the core library support junk into the Root language syntax
Other Library syntax injectors
EG: Rails 1.1.x injector, Rail 1.2 injector, Rails 2.0 injector,
Camping injector, etc…
Personal syntax additions
Inject support for all your personal libraries and classes and junk
Optional syntax niceties
EG: Rails 1.2 deprecated code, nested brackets, leading space, etc...
That way all of the layers are nicely segregated from eachother.
Nothing can really change the basic Ruby syntax, so a single
tmLanguage should scope the entire thing.
Then you can add stuff where you need it in a nicely segregated way.
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
Hi there,
I've been trying to send this to the dev list, but somehow the message
didn't make it to the list.
I'm trying to commit the wonderfull JavaScript Tools Bundle[1] by
Andrew Dupont to the repository, but it seems I'm not allowed to
commit outside "my" bundle (that would be ActionScript.tmbundle)
Is any of the JavaScript Bundle mantainer (or someone with full access
to the repo) willing to commit it?
Tha bundle is fully tested and ready for commit :)
Thanks in advance, and sorry for the OTish.
[1]: http://www.andrewdupont.net/2006/10/01/javascript-tools-textmate-bundle/
--
Ale Muñoz
http://sofanaranja.comhttp://bomberstudios.com
Hi,
I write a lot of JavaScript and some C and I find that the automatic
indenting doesn't work correctly very often when I cut an paste.
Textmate seems to think I want the pasted text indented more than it
should be. Does anyone else have this sort of trouble? Is there a fix?
Thanks,
Peter
Hi all,
I seem to have messed up my TextMate theme default and was wondering if
anyone could tell me how to fix it. I toyed with the colors of my
favorite theme (Vibrant Ink) and decided I didn't like the changes, so I
uninstalled and then reinstalled the theme. But now when I restart
TextMate it doesn't recognize Vibrant Ink (which does not show up in the
theme list). I looked in ~/Library/Applcation Support/TextMate/Themes,
and the .tmTheme file is there. So what's up? Any clues? I miss Vibrant
Ink :<
Thanks,
Jake
Hi All,
I'm using TextMate 1.5.4 (r1324) on Mac OS X 10.4.8 PPC. I've got the
subversion bundle from the GetBundles bundle, with the latest
tm_plugin checked out by hand from the Plugins dir in subversion on
the macromates server.
When I try to view the log of a file I get the following error, all
the other subversion features seem to work fine -;
NoMethodError
reason: undefined method `text' for nil:NilClass
trace:
/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Subversion.tmbundle/Support/format_log_xml.rb:22:in `author'
(erb):32
/opt/local/lib/ruby/1.8/rexml/element.rb:939:in `each'
/opt/local/lib/ruby/1.8/rexml/xpath.rb:53:in `each'
/opt/local/lib/ruby/1.8/rexml/element.rb:939:in `each'
/opt/local/lib/ruby/1.8/rexml/element.rb:398:in `each_element'
/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Subversion.tmbundle/Support/format_log_xml.rb:18:in `each_entry'
(erb):28
/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Subversion.tmbundle/Support/format_log_xml.rb:165
Thanks
---
Jeremy Wilkins
dear all,
i'd like to pose a few basic questions when using textmate for latex
files:
(1) is there a way to get the 'typeset & view window' display the log
file, the way you can have it with emacs?
it seems that changing the values of TM_LATEX_ERRLVL doesn't help ...
(2) is there a way to get textmate use a dvi-previewer? (for reasons
of speed, i still prefer dvi when working on my files).
(3) is it possible to change the fonts (i.e. same font as in in the
editing window) and the header of the 'typeset & view window'?
what's the place to do it?
thank you!
greetings,
christoph eyrich
In early Jan I made a bunch of changes to my blogging bundle, some
overrides, some I had to edit the .rb files by hand.
Whats the best way to compare my changes to the svn tree and submit
them as a patch to be reviewed?
Hi,
I am new to textmate and bibdesk. I am not able to format citations. I can
follow the tutorials but if I try to cite from bibliography completion I get
\cite{sh: line 1: /usr/local/teTeX/bin/i386-apple-darwin8.3.1/kpsewhich:
cannot execute binary file
sh: line 1: /usr/local/teTeX/bin/i386-apple-darwin8.3.1/kpsewhich: cannot
execute binary file
Ng1}
I am using a PowerPC G4, with os x 10.4.8 and textmate 1.5.4.
I have found some suggested workarounds by Özgür Gökmen... But unfortunately
don't understand what I should be changing or where to find some of the
files I need to change.
If anyone has had similar problems and can point me in the direction to
solving this error I would greatly appreciate it.
-Michael
Hello All,
Great to see such an active community for a text editor!
I've been using TM for a largish python project. I have quite a few
source files now and using the project draw and tabs to navigate
between them.
Anybody know how I can mark one file in my project as the file to run
using the Run Script Command.
Would I need to modify the Run Script Command for this to work?.
I've looked at it in the bundle editor but it makes no sense to me. I
tried hacking some changes in so that it would run a specific file
rather than $TM_FILEPATH but without luck.
Any help much appreciated.
Jay.
I've been trying to get the perforce bundle installed
on my macpro; I'm using the bundle browser at
<http://netcetera.org/cgi-bin/tmbundles.cgi>
I copied the script locally and ran it, and I kept
getting the error:
svn: Can't convert string from 'UTF-8' to native
encoding:
subversion/libsvn_subr/utf.c:464: (apr_err=22)
svn: Perforce.tmbundle/Commands/Submit
Changelist?\226?\128?\166.plist
I found that editing the script and adding the line:
export LC_TYPE
after the line that sets LC_TYPE fixes this problem.
The UTF-8 was for the ellipsis character.
Just FYI,
Rudi
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news
I want to have a regular expression that identifies the items in a
line from a comma-separate values (CSV) file.
Imagine one style of CSV, in which such items are all quoted (Format 1):
"First Item","String","0","Yes","Yes","No","The contents of the
string in the first item"
"Authority","ID","0","Yes","No","No","ID of the person
""responsible"" for the item, if known"
In CSV, double-quotes permit embedding commas (and spaces?) in record
fields. Double-quotes in such fields are escaped by doubling the
character.
The regex that matches the full text of the item is fairly
straightforward:
"((""|[^"]*)*)" # In quotes, a run of double-quotes and anything
else not a quote; make $1 hold the unquoted string
However, a field may be empty (represented by no characters between
the commas). This a special case of the less-paranoid (and arguably
more standard) way of writing the file (Format 2):
"First Item",String,0,,Yes,No,"The contents of the string in the
first item"
Authority,ID,0,Yes,No,No,"ID of the person ""responsible"" for the
item, if known"
The something-between-quotes regex doesn't pick up the nonquoted
fields (obviously).
So make the regex fancier, to make the quotes optional and recognize
the field separator (which does not exist at the end of the record):
("?((""|[^"]*)*)"?),?
This still works for Format 1, but in Format 2 it matches the whole
of any run of records that aren't quoted (String,0,Yes,Yes,No,").
Start from the other end, and try a regex that matches fields not
quoted:
([^,[:cntrl:]]*),? # any run of characters, including blanks, that
aren't controls or commas, and may end in comma
The exclusion of control characters prevents the matching of:
"The contents of the string in the first item"
Authority
If the next field is a quoted string with a comma in the middle, this
pattern stops at the embedded comma.
So maybe a pattern that combines the two patterns would work:
(("?((""|[^"]*)*)"?)|([^,[:cntrl:]]*)),? # match quoted fields if
you can, unquoted fields if you must.
No: This pattern matches
String,0,,Yes,No,"
in the first line of the Format 2 example. It's the same behavior as
the quoted-only pattern (matches runs of nonquoted strings).
Reversing it:
(([^,[:cntrl:]]*)|("?((""|[^"]*)*)"?)),?
behaves the same as the nonquoted pattern (matching stops at commas
within quoted strings).
I'm out of ideas. Does anybody have a suggestion?
— F
Is there a way, to see an RTF document without the RTF markup in it?
I have some 100 RTF files, and I need to do a global search and
replace. It is no problem I think, to do this in Textmate, cause the
things I will replace wont appear in any RTF commands, but i would
like to view the files properly at least. looking at all the RTF
markup is just a little confusing :)
Any suggestions on how to this another way? I am up for suggestions.
Thx in advance,
Thomas Krajacic
My quest for supporting CSV whizbangs in TextMate continues. I
created a very simple CSV language bundle, and can't get my CSV
commands (OK, so far, "command") to apply to the file.
I added a new bundle and named it CSV. Here is the language spec:
=============
{ scopeName = 'text.csv';
fileTypes = ( 'csv' );
}
=============
Simple enough. My problem may be that it's too simple. I'm figuring
that patterns and folding don't make much sense in a language as
simple (hah!) as CSV.
Opening a .csv file identifies the file as CSV (the language popup
says "CSV"). However:
- Trying to detect the scope inside the file (⌃⇧P) produces no
scope tip at all.
- The commands popup at the bottom of the window starts you off at
the top of the language list, not at CSV.
- Pressing ⌘R (the key equivalent for one of my CSV commands) gives
me a popup offering the ⌘R commands of two other bundles (including
Xcode)... which I now see specify no scope for those commands. My ⌘R
is scoped for text.csv.
Clearly my language spec does not suffice to give the contents of
a .csv file text.csv scope. I'm missing something. What is it?
— F
While we're on the subject of the blogging bundle (i.e., after reading
the previous post which reminded me), what's the status of Movable Type
categories? Any hope of getting them supported? At present, that's one
of the only things keeping me from using TM for all my blogging
(instead, I use MarsEdit along with a plugin that lets me convert
keywords to tags).
Yours,
Andrew
I'm not sure how to put this without sounding like a demanding
ingrate, but here goes...
I've been using Brad Choate's persistent include commands since the
day they came out, because they are brilliant for my way of working.
But (here it comes) they would be so much more brilliant still if it
was possible to update any files selected in the project drawer
whenever an included file was changed.
I know about TM_SELECTED_FILES, but I can't see how to apply a
command to all of them in place. The only thing I could think of
involved creating temporary files, which doesn't seem the right way
to be going about this.
Any suggestions?
A new file in TextMate:
====================
p "testing rubymate"
====================
command+R to see the output in RubyMate and here's what I get:
Output in Run Window:
/bin/bash: line 4: DISPLAY has been set to :0.0 /usr/bin/ruby: No such
file or directory
Where did my precious RubyMate go?
This seems to happen quite often...
I have:
<h2>Download Our Catalog</h2>
Which needs to become:
<h3>Download Our Catalog</h3>
How would I go about writing a snippet/command that would allow me to
select "<h2>Download Our Catalog</h2>", activate the snippet, and have
the tag become selected ("h2" in this case) and mirrored in the
closing tag, therefore allowing me to simply type "h3" and then tab
back out?
the indentation looks as if it is indenting the next line if there is
not a semicolon on the end of the previous line which is fine except
when the previous line is a comment like this
#init var
$var = 2;
should be
#init var
$var = 2;
i notice that this is only happening since allan's updates.
Thanks
Kim
I often find that I paste something into a document, then immediately
select it to do something to it, like wrapping it in tags or
converting characters to entities. Long ago I used an editor
(possibly alpha) that had a 'select pasted text' command, that did
the selection straight after a paste, without having to drag over it
or whatever. I can't find an equivalent command in TextMate, nor any
environment variables pointing to the start and end of the latest
pasting that would let me implement it myself.
Have I missed something? Either a command in some bundle I don't know
about or some other way of achieving the same effect?
If not, here's a feature request. Any one of the following:
Select Pasted Text command
Paste and Select command (extra modifier key on cmd-V)
Select after Pasting preference.
Thanks for any help or pointers.