I'm trying to use a regex transformation in a snippet that will
convert the first letter of a word to uppercase and convert underscore
_ followed by a letter to a space and an uppercase letter.
eg:
field_name > Field Name
long_field_name > Long Field Name
I can't quite get get my head round how to do it, as it seems like two
seperate transformations, but I'm not sure how to to do
transformations on a string in a snippet.
Is there a collection of regexes for transforming between the main
cases? (particularly Camel, Title and underscore seperated) I managed
one that went from CamelCase to underscore_seperated:
${1/([a-z0-9])?([A-Z])/(?1:$1_)\l$2/g}
Thanks
Ed
Hi there,
Well, that's pretty simple : I create a project
by dragging a bunch of files in the project
drawer… Fine…
After that, I move some of those files somewhere
else with the Finder or whatever : TextMate has “lost”
the moved files which now appear in red…
I cannot believe I am the only one bothered by
this behaviour… Or am I ? :-)
I'm working on a Wordpress blog and sometimes need to comment out
blocks of intermingled PHP and HTML. Don't get me started on either
PHP or interspersing code and markup. Anyhow, here's a hackish
command that toggles an if(false) block:
#!/usr/bin/env ruby
lines = STDIN.readlines
php_regex = /\<\?php/i
if lines[0] =~ php_regex
lines.each{|l| puts l unless l =~ php_regex}
else
puts '<?php if(false) { ?>'
lines.each{|l| puts l}
puts '<?php } ?>'
end
Hope this is useful to someone...
Has any one written a .ctags.tmcodebrowser code for seeing markdown or
multimarkdown in the CodeBrowser?
Thought I would ask before I spend an inordinate amount of time trying
to figure out how to write the regex for it.
Thanks
__________________________________________________________
Robert Ullrey
Phone: (916) 600-5619
E-mail: robert_ullrey(a)mac.com
Please avoid sending me Word or PowerPoint attachments.
Please send as universally readable RTF files.
See http://www.gnu.org/philosophy/no-word-attachments.html
When I attempt to update a directory with the SVN bundle, I get this error:
ruby: No such file to load -- /Users/offline/Library/Application
Support/TextMate/Support/bin/shelltokenize.rb (LoadError)
shelltokenizer.rb _does_ exist, however -- it's in ~/Library/Application
Support/TextMate/Support/lib.
If I symlink it into ../bin, I get this:
/Applications/TextMate.app/Contents/SharedSupport/Bundles/Subversion.tmbundle/Support/format_status.rb:4:in
`require': No such file to load -- /Users/offline/Library/Application
Support/TextMate/Support/bin/Builder.rb (LoadError) from
/Applications/TextMate.app/Contents/SharedSupport/Bundles/Subversion.tmbundle/Support/format_status.rb:4
-:13:in `write': Broken pipe (Errno::EPIPE) from -:13:in `puts' from -:13
from -:13:in `each_line' from -:13
Obviously this last is not supposed to happen under any circumstances, but
it did seem like a possible quick fix at the time :)
Anyway, there appears to be a bug in that bundle.
I have TM build 1215, if that makes a difference -- wasn't there supposed to
be a new release coming soon?
--
Chris R.
======
Not to be taken literally, internally, or seriously.
Is there a way to have an auto saving and auto loading of projects?
I work on two computers, and I often have TextMate running on both.
When I synchronize files (using http://www.cis.upenn.edu/~bcpierce/
unison/index.html), TextMate picks up the changes automatically and
visually tells me a file is not saved. However there is no visual
clue that a project is not saved, and changes done to the tmproje
file are not picked up automatically.
I guess I could close all my projects before synchronizing, but I
find it really convenient to have TextMate running all the time.
(By the way, projects are a great feature and they make my working
with many TeX files much easier and more efficient.)
Thanks,
Alan
--
Alan Schmitt <http://alan.petitepomme.net/>
The hacker: someone who figured things out and made something cool
happen.
.O.
..O
OOO
Hi all,
I just changed the python new function command to do some fun things
when one of python's 'special methods' is the name used for the new
function. So now, if you press ⇧↩ after typing a word like "setattr",
"cmp", "repr", or "init", you'll get a function that looks like:
def __setattr__(self, name, value):
pass
or
def __cmp__(self, other):
pass
I hope that people find it useful. The one downside to this method is
that if you want to name a function the same way as one of these special
methods (but without the underscores), then using ⇧↩ will not work as
before. So in that case use the "def" tab trigger.
Also, we may want to figure out a way to get these to execute with the ⇥
key instead of using ⇧↩
In general, I'm surprised that there hasn't been more progress on the
python bundle, given how many people claim to use it.[^1] I suppose I'm
as guilty for this as anyone. Anyway, us TM python users need to start
adding useful stuff to the bundle. It's hard to think of things, given
that the language is pretty low on extraneous baggage, but I'm sure
there are places where we can speed ourselves up.
-Jacob
[^1]: http://macromates.com/wiki/Polls/WhichLanguageDoYouUse
The one thing preventing me from making a complete switch to textmate
is the lag when the app regains focus when viewing a project
contianing folders on network mounts.
I noticed that the manual mentions this behavior, and also says it
will be addressed in a future release... Anyone have a time table
around this?
Thanks,
Ben
------
http://macromates.com/textmate/manual/working_with_multiple_files
2.1.1 Auto-Updating Projects
Currently updating is done when TextMate regains focus and can be slow
for some network mounted disks, in which case you may want to settle
for only adding individual files to the project (which can be grouped
and re-ordered manually to mimic the structure on disk).
The refresh delay for network mounted disks will be addressed in a
future release.
Hi!
I recently noticed, that alt+F2 invokes the spelling menu. Really
good. But spelling errors are recognized, when I type a blank symbol.
So I have to move the cursor back and type alt+F2. Is it possible to
invoke the spelling menu for the last misspelled word? And perhaps
there could be an own TextMate spelling menu which has shortcuts for
the entries.
Helge
Hi,
I'm a new to textmate and loving it so far. i have a couple of
questions that i've saved up after my first week of use that i was
hoping someone could help me with:
* i find that snippets make it easy to add text - but i'm not so sure
how to modify existing text. e.g. i find i am always commenting out
code in css, so i added this snippet (and bound to a key):
/* $TM_SELECTED_TEXT */
great! ok, now how would i remove comments? (or even better, how to
toggle comments on the current line?)
* hard-wrap: i know textmate doesn't support this out of the box, but
with vi i always used "fmt". so here's my command which i bound to a
key:
fmt << ___END___
$TM_SELECTED_TEXT
___END___
this isn't ideal (what if the text has ___END___ in it? fmt barfs on
non-ascii, and i always get an extra newline.) is there a better way?
* some snippets show a series of options, which you cannot select (they
just get erased when you start to type.) what's the idea - just a
simple reminder - or am i using it wrong? e.g. in the css bundle:
list-style-type: ${1:none/disc/circle/square};$0
why not just make 4 snippets - so then you get the popup and can choose
which one? (so i could hit '1' instead of typing in 'none'.)
well, i've got lots more questions, but that's probably enough for now.
:jason