How can I comment out a region (selection) of code? In other words, select
several lines of code, right click (or key combo) and comment out that
section (adding the correct lang comment tag).
Thanks
Stephen cox
--
View this message in context: http://www.nabble.com/Add-a-comment-region-tp17397875p17397875.html
Sent from the textmate users mailing list archive at Nabble.com.
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\./
…
[View More] 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
[View Less]
Hi all,
I have made some changes to the way that scripts are run. To
accommodate this I had to update the Ruby and Python bundles to be
compatible (it's a change for the better).
If you update either of these bundles, you are going to have to update
Support as well if you want the Run (⌘R) commands to work.
I do apologise for any inconvenience, but it is for the best.
LD.
Hello,
I'm relatively new to TextMate.
When I try and launch textmate from the terminal (via 'mate'), textmate
hangs.
Interestingly, if textmate is already open, this doesn't occur.
Eventually I have to force quite textmate. I am running Leopard (10.5.2) on
an Intel Core 2 Due iMac.
Anyone else have this problem?
Thanks.
Steve
Hello,
I just want to ask if anybody can confirm TM taking the 564MB physical
(1.3GB VM) with this simple test:
$ otool -tv /Applications/TextMate.app/Contents/MacOS/TextMate > /tmp/
tm.s
/tmp/tm.s is ~11MB
Close TM, and run:
$ mate /tmp/tm.s
Open Activity Monitor and check TM memory usage.
It means if I open 3 such files I'm out of my RAM. This is really
nothing good. I'd accept 1:5 filesize/mem usage ratio, but 1:50 is
kind too much.
Would it be any better in TM 2.0? I hope …
[View More]we can try some beta soon.
Regards,
--
Adam Strzelecki |: nanoant.com :|
[View Less]
Hi again,
I have added process.rb to Support/lib. It has a single method,
TextMate::Process.run() that can be used to gracefully handle opening
processes and capturing their output. I would encourage everyone to
use it if you are scripting processes. Especially if you want the
process to take advantage of the interactive input features which
should be released sometime in the near future. If processes are
opened with this method, then they should benefit from any other
features …
[View More]that are added for dealing with processes over time.
There is a blurb in the file on how to use it. Would be interested to
hear any comments you might have on it.
Just to clarify the implication of this…
In the next release of TM on (once the bundles have been updated to
use TextMate::Process.open()) whenever a process requests input, a
dialog will be presented to the user giving them a chance to enter
input. The classic use case for this is the Subversion bundle. No more
never ending commits while svn is waiting for you to enter your
credentials.
LD.
[View Less]
Hi
trying to have a dynamic dict inside TM, I have build the next command
dict "$TM_CURRENT_WORD" | enscript -Whtml -E -e --color -p -
with Input: sel text or word, output html
but I only get a window with the message:
enscript: malformed argument `html' for option -W, --option: no comma
found
while the same command in Terminal do fine
dict word | enscript -Whtml -E -e --color -p -
But if you put
dict "$TM_CURRENT_WORD" | enscript --language=html -E -e --color -p -
it …
[View More]works perfectly! I feel curious about it.
Juan Falgueras Cano
Profesor Titular de la Universidad de Málaga
[View Less]
Hi,
Anyone seen Chandler McWilliams, creator of the Processing bundle?
I've a patch attached for the Run command. It basically works the way
you think it should now.
Cheers,
yong
Hi, I’m trying to use ${5:helper text} variable in my regular expression
later in the code:
${5/(e)|(.*)/(?1:\te.preventDefault\(\);\n)(?2:)/}})
What I do here? I check if $5 equals "e" and if it does, I append
".preventDefault();" to my "e". But I’d like to write something like this:
${5/($5)|(.*)/(?1:\t$5.preventDefault\(\);\n)(?2:)/}})
Which simply means I’d like users to be able to change "e" into, for example
"event".
My whole snippet, for better understanding:
bind('${1:event name}'$…
[View More]{2:, ${3:passed object}}, function(${4:e}) {
${0:$TM_SELECTED_TEXT}
${4/(e)|(.*)/(?1:\t\/$4.preventDefault\(\);\n)(?2:)/}})
--
View this message in context: http://www.nabble.com/Snippet%E2%80%99s-%24variables-in-RegExp-tp17302873p1…
Sent from the textmate users mailing list archive at Nabble.com.
[View Less]