Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use control-K as an extra clipboard in Cocoa apps Apps
Most readers here know that most emacs keyboard shortcuts work in cocoa apps (e.g., Control-A to go the beginning of a line). I've been aware of this for a while, but last night noticed something nice. You can use Control-K to cut a pice of text (and Control-Y to "yank" it back) independently of the default OS X Command-X and Command-V cut and paste commands. This means that if you need to have two pieces of information quickly accessible, you can have both of them ready to paste with just a couple of keystrokes.
    •    
  • Currently 2.40 / 5
  You rated: 1 / 5 (5 votes cast)
 
[7,971 views]  

Use control-K as an extra clipboard in Cocoa apps | 8 comments | Create New Account
Click here to return to the 'Use control-K as an extra clipboard in Cocoa apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use control-K as an extra clipboard in Cocoa apps
Authored by: milk on Dec 19, '03 01:22:21PM

Doesn't work, they share clipboards.

---
-- "An eye for an eye leaves us all blind." - Gandhi



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: mcginniwa on Dec 19, '03 01:37:29PM

Works in 10.2 mail.app. However, it leaves me longing for multiple yanks from the kill ring (M-Y after C-Y).



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: ether on Dec 23, '03 12:51:39PM

In general, it seems that all the emacs kill-ring stuff works (at least in Terminal, where I checked it). That means you can:

* mark a region (ctl-space, arrow/control-{b,f}
* copy region to the kill ring (meta-w)
* yank the most recent kill (ctl-y)
* substitute what you just yanked with an earlier entry from
the kill ring (meta-y right after the ctl-y; subsequent meta-y's
will substitute earlier kills)

Of course, you could also just use PTHPasteboard, which lets you
see the contents of multiple clipboards, select random stuff to clip
(including images), and have separate, permanent or semi-permanent, clipboards).

:-)



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: osxpounder on Dec 19, '03 01:41:36PM

Works for me, but only when editing text in a Cocoa app [I only tried TextEdit].

I can select a block of text, then use the normal copy and paste: a block of text a block of text a block of text ....

Then I can select another few words, and use CTRL-k to "kill" it, then "yank" it back [i.e., "cut" it, then "paste" it]: another few words another few words another few words ...

... and I still have the same content stored in the normal ClipBoard, so that if I type Cmd-v, then CTRL-k, then Cmd-v, then CTRL-k, etc., I get:

a block of text another few words a block of text another few words a block of text another few words .... see?

The reason I repeat it so much is to test that I can, indeed, paste each text bit again and again: a block of text another few words a block of text another few words ....

Working well for me in 10.3 [I haven't upped to 10.3.2 yet]

---
--
osxpounder



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: gunnmjk on Dec 20, '03 01:57:27AM

it does work, and that's one of the coolest hints i've seen.



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: vondrix on Dec 20, '03 07:13:23AM

Does anyone know how to kill the text before the cursor? In the terminal I use ctrl-u, but apparently that doesn't work. (it's not an emacs shortcut apparently)



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: howi on Dec 30, '03 10:26:55AM

use "shift + alt + backspace"

:-) howi



[ Reply to This | # ]
Use control-K as an extra clipboard in Cocoa apps
Authored by: gralem on Dec 20, '03 10:06:07AM

This is a fairly cool hint, but I have found that it only works within a single app (you cannot cut from TextEdit and yank into Safari).

Also, CTRL-K is only "CUT", so you cannot select text in non-editable regions (such as most things displayed by Safari, or most things in Terminal--it does work if your move the cursor around on the active line). Is there a COPY command that will work in non-editable regions?

But this is very cool even with these limitaions.

---gralem



[ Reply to This | # ]