[TxMt] Re: manipulating full lines rather than selection
Hans-Jörg Bibiko
bibiko at eva.mpg.de
Fri Nov 5 14:00:22 UTC 2010
Hi,
for such cases I wrote the TMTOOLS plugin
http://email.eva.mpg.de/~bibiko/downloads/textmate/
help:
http://email.eva.mpg.de/~bibiko/downloads/textmate/tmtoolshelp.html
If you install it (on your own risk ;) then you can write this tmcommand and bind it to any short-cut:
Save:
nothing
Command:
if [ ${#TM_SELECTED_TEXT} -gt 0 ]; then
"$TMTOOLS" set caretTo "{line=$TM_INPUT_START_LINE;column=0;}"
if [ $TM_LINE_NUMBER -eq $TM_INPUT_START_LINE ]; then
"$TMTOOLS" move selectionBy "{line=0;column=$((${#TM_SELECTED_TEXT} + $TM_COLUMN_NUMBER - 1));}"
else
"$TMTOOLS" move selectionBy "{line=$(($TM_LINE_NUMBER-$TM_INPUT_START_LINE));column=$(($TM_COLUMN_NUMBER - 1));}"
fi
fi
"$TMTOOLS" call command '{name="Comment Line / Selection";}'
Input:
nothing
Output:
Show as Tool Tip
Have fun,
--Hans
More information about the textmate
mailing list