
macos剪切

Everyone knows about cutting and pasting by now. But did you know that your Mac sort of has a second clipboard known as kill and yank?
現在,每個人都知道剪切和粘貼。 但是您是否知道Mac上還有第二個剪貼板,稱為“ kill and yank”?
Kill and yank?originates from Emacs, which is a “family of text editors that are characterized by their extensibility.” If you’ve never heard of Emacs, that’s okay—it’s usually found on Unix and Linux systems. Emacs is said to have over 2000 built-in commands, of which the aforementioned kill and yank are two of them.
Kill and yank源于Emacs,Emacs是“以可擴展性為特征的文本編輯器家族”。 如果您從未聽說過Emacs,那就沒關系-通常在Unix和Linux系統上可以找到。 據說Emacs具有2000多個內置命令,其中上述的kill和yank是其中的兩個。
Killing?is similar to cutting, and yanking is like pasting…with some slight (useful differences).
殺死類似于剪切,猛拉就像粘貼……有一些細微(有用的區別)。
To try it out, open TextEdit from the Applications folder or using Spotlight. Then load up?a document you’ve created, or simply?create some new text.
要進行嘗試,請從“應用程序”文件夾或使用Spotlight打開TextEdit。 然后加載您創建的文檔,或者簡單地創建一些新文本。
The kill command is Control+K, and the yank command is Control+Y. For the most part, they work just like cut and paste. You can select any portion of a text document and kill it (cut), and then yank it (paste) back into your document or somewhere else.
kill命令為Control + K,yank命令為Control + Y。 在大多數情況下,它們的工作就像剪切和粘貼一樣。 您可以選擇文本文檔的任何部分并將其殺死(剪切),然后將其拉回(粘貼)回到您的文檔或其他位置。

You can use this as a second clipboard (so you can store two strings of text at a time), but here’s the other cool part: you don’t necessarily have to select text to use kill and yank.
您可以將其用作第二個剪貼板(這樣就可以一次存儲兩個字符串),但這是另一個很酷的部分:您不必選擇要使用kill和yank的文本。
For instance, in the following example, we typed out some quick text. By simply inserting the cursor at the end of “word” and using the?kill command, we cut everything from there to the end of the line of text, and then yanked it back.
例如,在下面的示例中,我們輸入了一些快速文本。 通過簡單地將光標插入“ word”的末尾并使用kill命令,我們將所有內容從此處剪切到文本行的末尾,然后將其拉回。

The works just as well?if you were to insert the cursor at the beginning of a long paragraph or sentence. Instead of selecting the whole thing so you can cut?it, you can simply insert the cursor?at the beginning and kill it, no selecting required.
如果將光標插入到較長的段落或句子的開頭,效果也一樣。 無需選擇整個對象即可剪切它,您只需將光標插入開頭并殺死它,而無需選擇。
This will work across a variety of applications such as Notes, Reminders, and Mail, so you’re not limited to just using it on TextEdit. We’ve found that it works in Chrome, but not Microsoft Office apps—even more oddly, kill seems to work in Slack, but Yank doesn’t. So your mileage may vary in terms of which apps can take advantage, but it can be a powerful addition to your daily toolbox.
這將適用于各種應用程序,例如Notes,提醒和郵件,因此您不僅限于在TextEdit上使用它。 我們發現它可以在Chrome瀏覽器中運行,但不能在Microsoft Office應用程序中運行-更奇怪的是,kill似乎可以在Slack中運行,但Yank卻不行。 因此,就哪些應用可以利用而言,您的工作量可能會有所不同,但這可能是您日常工具箱的有力補充。
Just remember, cut and paste are initiated with the Command key, whereas kill and yank are done with Control.
只需記住,剪切和粘貼是通過Command鍵啟動的,而kill和yank是通過Control完成的。
Image Credit: Bruce Guenter/Flickr
圖片提供: Bruce Guenter / Flickr
翻譯自: https://www.howtogeek.com/293850/how-to-use-macos-built-in-kill-and-yank-as-an-alternative-cut-and-paste/
macos剪切