19

How do I select text using the keyboard?

After selecting text, I click on Edit. It shows Copy <copy>.

How do I copy text using the keyboard?

Zanna
  • 72,471
sam
  • 6,941

3 Answers3

39

Press Ctrl-Space to mark start of block.

Move cursor until end of block.

Press Alt-w to copy

Move to insert position

Press Ctrl-y to paste

enzotib
  • 96,253
  • 1
    I can't select by ctrl+space,and if I use mouse to select,I also can't copy by alt+w. What happened? – sam Sep 16 '11 at 14:52
  • @sam: Ctrl-space do not select, only mark the start of block. Then you will see the selection expanding if you move the cursor. – enzotib Sep 16 '11 at 15:11
  • Sorry for my typo unclearly,I know I should use keyboard to move cursor. When I press Ctrl+space it just open input method like scim. Even when I use mouse to select,I also can't copy by alt+w. Because when I open gedit to paste,it appears nothing. – sam Sep 17 '11 at 05:41
  • I mean to copy and paste inside emacs itself, don't know if it work to paste outside of it. And you can try Ctrl-@ instead of Ctrl-space. – enzotib Sep 17 '11 at 07:41
  • I have tried ctrl+2 and ctrl+shift+2 (means ctrl+@) with keyboard's direction key(up,down,left,right on the right of keyboard), but I also can't select any characters. – sam Sep 17 '11 at 09:30
  • Works perfectly in Emacs in Android Termux – G 1 Oct 02 '19 at 00:09
  • If you want to cut instead of copy, you can press Ctrl instead of Alt. – baptx Feb 21 '22 at 22:16
4

I found another way just the same as windows' operations.

Emacs menu > Options > C-x/C-c/C-v Cut and Paste (CUA).

That option will let me use Shift+Arrow keys to select, Ctrl+C to copy, and ctrl+V to paste.

But it only work in emacs. It could not paste on gedit.

If I want to paste to gedit, I should use menu > edit > copy.

I didn't find any shortcut to menu > edit > copy.

Eliah Kagan
  • 119,820
sam
  • 6,941
0

Try turning on PC Selection mode. See also the copy/paste page on emacswiki

Tom
  • 132
  • Is PcSelectionMode also support for normal emacs or should I install another emacs? By the way,I know C- means ctrl, M- means alt, and what's S- ? – sam Sep 17 '11 at 05:41
  • It should be available in the default installation of GNU Emacs. You can try turning it on with M-x pc-selection-mode – Tom Sep 17 '11 at 06:22
  • Thank you~ I have loaded pc-selection-mode. How to press S- ? – sam Sep 17 '11 at 09:27
  • @sam: I suppose S is the Shift modifier – enzotib Sep 17 '11 at 09:34