[TxMt] Re: TM2:feature suggestions CMD+C just copy current line without selection

Allan Odgaard mailinglist at textmate.org
Wed Aug 29 18:23:07 UTC 2012


On Aug 29, 2012, at 4:21 PM, Yuan Jiang <sleetdrop at gmail.com> wrote:

> Sometimes I use intellij idea, it's text editor has a default behavior
> for CMD+C, if you don't select anythings, it will copy current line.
> While CMD+X will cut the current line.  Maybe it's not a bad idea.

This is very the new ‘dyn.selection’ scope selector comes in handy, here are two commands bound to ⌘C and ⌘X respectively, but only when there is no selection:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Copy.tmCommand
Type: application/octet-stream
Size: 852 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20120829/7124f180/attachment.tmCommand>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cut.tmCommand
Type: application/octet-stream
Size: 856 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20120829/7124f180/attachment-0001.tmCommand>
-------------- next part --------------


They work on the line without the newline though. For including the newline, they should probably be macros instead that does a line select followed by cut/copy — that might actually be better also because we then use the “real” cut/copy of TM (which is certain to work with clipboard history), but as 2.0 can’t yet save macros, commands it was…



More information about the textmate mailing list