[TxMt] Re: about cut and paste the whole line

dvlogic dvlogic at gmail.com
Mon Oct 13 17:19:08 UTC 2008


Its really simple to make it smart and use the CMD-X key (dual purpose). 

Create a command called "smartcut" with the following:


#! /bin/sh
#
if [ "x$TM_SELECTED_TEXT" = "x" ]; then
	text="$TM_CURRENT_LINE";
else
	text="$TM_SELECTED_TEXT";
fi

echo -n "$text"|pbcopy


Set the input to "Selected Text" or "Line" and the output to "Replace
Selected Text".  Then set the Key Equivalent to CMD-X

The standard CMD-V will paste the whole like back.

-- dv



-- 
View this message in context: http://www.nabble.com/about-cut-and-paste-the-whole-line-tp19948444p19959022.html
Sent from the textmate users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20081013/086c9a18/attachment.html>


More information about the textmate mailing list