I would like to be able to click on a line of text without selecting it, and use a keyboard shortcut to copy all text on the current line. Is this possible? If so how?
4 Answers
Closest thing to that is ⇧⌘L followed by ⌘C.
-
1You could use the Macro Editor to save this sequence (Bundles > Macros > Start Recording) and give it a key combination. Works like a charm. (Just make sure you uncheck the "use local clipboard while executing macro" option at the bottom of the macro in the Bundle editor.)– ghoppeJul 10, 2010 at 6:46
-
Thanks to the macro tip! Given the awesomeness of TextMate, I can't say that one simple macro inconveniences me! Jul 11, 2010 at 14:46
Don't know if this helps but another useful one is Ctrl+Shift+D which will take the current line and duplicate it right below.
To have that in all standard text views, create ~/Library/KeyBindings/DefaultKeyBinding.dict
that looks like:
{
"^~c" = ("selectParagraph:", "copy:"); // ⌃⌥C
}
For more info, see Cocoa Text System.
Some of TextMate's text editing shortcuts are defined in a similar property list file at /path/to/TextMate.app/Contents/Resources/KeyBindings.dict
. Modifications should be made to a copy in Application Support
as usual.
You can use the emacs bindings. Most Mac apps support them. Control-k (kill) cuts the line to the emacs equivalent of a pasteboard and control-y (yank) pastes the results back. This pasteboard is different from the regular Mac pasteboard and with TextMate only appears to work with one window. If you control-k then control-y it is the equivalent of copy.