Inspired by the customization screencast [1], I decided to write a
reflow command for us Java users. It's designed for reflowing JavaDoc
comments. Based heavily on Allan's original code, it works well
except for one problem: The reflowed text is never indented, even
though I've set the output to "Insert as Snippet." Anyone know how to
fix this?
Here's the command:
#!/usr/bin/env ruby
# Grab comment text
txt = STDIN.read
# Remove beginning and ending slashes
txt = txt.gsub(%r{\A[ \t]*/|\s*\*/\s*\z}, '')
# Remove leading bullets
txt = txt.gsub(/^[ \t]*\*+[ \t]*/, '')
# Escape single quotes
txt = txt.gsub(/'/, "'\\\\''")
# Use fmt command to reflow text
txt = %x{ fmt <<< '#{txt}' }.chomp
# Put leading bullets back in
txt = txt.to_a.join(' * ')
# Escape special snippet characters
txt = txt.gsub(/[$`\\]/, '\\\\\0')
# Put cursor marker on last line
txt = txt.sub(/\n?\z/, '$0\0')
# Put beginning and ending slashes back in
txt = "/**" + txt + "\n */\n"
print txt
I've set the input to "Selected Text or Scope" and the scope to
"comment.block.documentation.java".
Thanks,
Trevor
[1] http://macromates.com/blog/archives/2006/04/12/customization-
screencast/
Hi List,
I'm using textmate now for round about two months (c,c+
+,latex,css,php,sql,html,css) and now i'm searching for a manual or
something to create my own templates.
Robert
:wq!
Hi all,
How do I stop textmate from re-indenting on ';'?
Textmate and I mostly agree on indenting, but we disagree about
how to indent some things. I'm happy with it getting this roughly
right when I hit return to get to a new line, BUT, if I change the
indenting and then type the rest of the line, having it screw up my
indenting when I reach the end of the line is REALLY annoying. And
no, just typing the ; first is not the answer I'm looking for.
I like the indenting being roughly right when I add a new line...
I just wish it wouldn't change it once I've explicitly set it (unless
I explicitly ask it two, and typing a ; to end a line is not asking).
Be well,
Will :-}
When working on R source files I am unable to enter dollar signs in
column editing mode. When I select a column and type $, only one is
entered in the first line and the column mode is left. This happens
regardless of width of selection.
On my system I can replicate this by creating a new R file consisting of
foo_bar
foo_bar
selecting the column with the underscore and typing $
which yields:
foo$bar
foobar
with the caret after the $.
Oddly this doesn't occur if I type another character before typing the
dollar sign.
TIA
Peter
>>> blah['name|']
>>> So, now what do I do???
>>>
>
> I think a nice new feature here would be to allow the null-action
> of "tab"
> to be to jump over any auto-created paired-chars. Then we could
> just tab out
> of the nest and carry on. It must be very seldom that users want a
> real tab
> character inside paired-characters.
I have disabled Auto Pairing in preferences and have defined several
commands like the next one for () pair. I feel it more intuitive and
coherent: you have a kind of snipped only when you are writing under
the assumption you are are inside pairs but you must ask for it apart
the usual ( character that is yet there. _For me_ is very stupid to
need to delete the ) char so frequently because you usually are re-
touching code, not writing it down like a literary work...
#!/usr/bin/env ruby
if ENV['TM_SELECTED_TEXT'] == nil
print '($1)$0'
else
$s = ENV['TM_SELECTED_TEXT'].to_s.gsub(/(?=[$`\\])/, '\\')
print "(#{$s})$0"
end
--- Command (Opt-Cmd-8, from old Mathematica), Use Selected text of
nothing, insert as a snipped
Then when you want a single (, use (.. and when you want a (|)|
use the command.
Hi Folks,
I am working on my german thesis and and arranged all tex files
within a project. One part - it's the abstract - is in english. When
I edit this english abstract TM slows down dramatically. Im not a
fast typing user, but after writing a sentence I have to wait until
TM catches up.
Parallel I checked the cpu usage and raises up to 60%. I do not have
this problem with other german tex files within my project.
Any hints how this problem could be solved? If the file is required,
just give me a shout.
Christian
Hi,
I'm new to TextMate and have the following question:
After highlighting rows of text, I can type Command+] and Command+[ to
change indentation levels, but I would like to hit Tab and Shift-Tab
instead (or as well).
Is there a way to configure TextMate for this?
-Chuck
I've finished a fairly stable version of an Actionscript3 Bundle for
Textmate.
With the upcoming release of Flash CS3 I couldn't wait any longer!
To all that need or want to play please visit:
http://blog.chromaticrain.com/page_id=5 Actionscript3 Bundle for TextMate
If you would like to support this bundle you can email me, leave comments,
or simply post a link on your blog or somewhere on the internet!
Cheers,
Robert Payne
Flash Developer
--
View this message in context: http://www.nabble.com/Actionscript3-Bundle-For-TextMate-tf3575232.html#a999…
Sent from the textmate users mailing list archive at Nabble.com.
OK, so we know there are plenty of people here that would like to be
able to do everything with the keyboard so they have to reach over to
the mouse as little as possible.
Me, I confess I use the mouse ALL the time:
- Moving more than 2 lines? Use the mouse...
- Making ANY kind of selection? Use the mouse...
- Browse through code? Use the mouse...
...
I never could get the hang of using a gazillion shortcuts to make the
cursor fly, and I have been programming professionally (well, at
least making a living of it) for 25 years.
So am I really alone, or are there others out there like me? If yes,
please speak up! I think we need to join and speak up, so that Alan
knows we exist and stops catering exclusively to the "keyboard only"
users!
My name is Gerd, and I like to use the mouse!