how can I copy a quote and paste it onto an emacs file? the shortcuts please?. I have tried to type the text but it is too long to write by hand.
-
1The question seems unclear. What do you mean by " a quote"? A single-quote character (curly or straight)? A double-quote character (curly or straight)? Some text that you want to cite, as a quotation? The text to be copy+pasted being "too long" suggests that you don't mean a quote character. But please clarify. Consider providing a recipe showing what you want to act on as the input and what result you want.– DrewMay 29, 2021 at 19:29
-
Copy from where? Is Emacs running in a terminal (as implied by the tag)? If so, on what operating system, and in what terminal application if applicable?– Gilles 'SO- stop being evil'Jun 28, 2021 at 20:12
1 Answer
M-w
copies the selected text into the operating system clipboard, as well as into Emacs’ internal storage.
C-w
cuts (or “kills”, a name which derives from the very oldest predecessors of Emacs) the selected text, putting it into both the operating system’s clipboard as well as the internal storage. C-k
kills all the text from the point to the end of the line.
C-y
pastes (or “yanks”, as it is generally called in Emacs) text into the document.
The internal storage forms a list of all the things you have copied or killed. C-y
yanks back the text from the head of this list. If you then hit M-y
, the yanked text will be removed and replaced with the text from the next entry in the list. You can keep hitting M-y
to go farther and farther back in the list. When you get to the end of the list, the next M-y
will wrap back around to the beginning again, so this list is called a ring. Thus in the Emacs documentation this is called the kill-ring
.
In your case you want to copy the text from whatever you’re viewing the quote in, and then go to Emacs and type C-y
.
I recommend reading the Emacs manual for more information like this. In your case I recommend starting with chapter 12, Killing and Moving Text, which deals with all the ways to cut, copy, and paste text.
In addition to reading the manual online, you can also read it within Emacs itself. Typing C-h i
will bring up the info viewer. This normally starts at an index of all the manuals installed on your computer, which should at least be the Emacs Manual and the Emacs Lisp Manual, but may include dozens or hundreds of manual from all kinds of programs you have installed (mostly this depends on the operating system that you are using). Select the Emacs Manual, then go down to the chapter you want and select it.
As an Emacs beginner, you may also find the built–in Emacs tutorial helpful. You can access it by typing C-h t
.