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?


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

  • 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 5: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 6:22
  • Thank you~ I have loaded pc-selection-mode. How to press S- ?
    – sam
    Sep 17 '11 at 9:27
  • @sam: I suppose S is the Shift modifier
    – enzotib
    Sep 17 '11 at 9:34

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

  • 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 5: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 7: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 9:30

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.