[TxMt] snippet and command questions (toggle comments, hard-wrap,	etc.)
    Jason Moore 
    jmoore at xinsight.ca
       
    Wed Oct  4 14:10:37 UTC 2006
    
    
  
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
    
    
More information about the textmate
mailing list