Книга: Learning GNU Emacs, 3rd Edition

2.7.2 Turning On CUA Mode for C-x, C-c, and C-v to Cut, Copy, and Paste

2.7.2 Turning On CUA Mode for C-x, C-c, and C-v to Cut, Copy, and Paste

If you're new to Emacs, you might be used to the Common User Access (CUA) conventions for cutting, copying, and pasting, C-x, C-c, and C-v respectively. You might reach for C-z for undo. CUA mode was once an add-on mode that you had to install separately, but it became so popular that it is now part of Emacs. It's coded in a clever way that doesn't interfere with Emacs keystrokes that are prefixed with C-x and C-c. Details on CUA mode can be found in Chapter 13.

You can turn this feature on through the Options menu to try it out. Simply choose Options ? C-x/C-c/C-v cut and paste (CUA). After you select this option, a check mark appears next to it on the Options menu. To keep it for subsequent sections, select Save Options from the Options menu. Emacs writes your .emacs file for you. If you turned off the toolbar and then set this option, your .emacs file would look like this (note that the line relating to CUA mode is bold so you can see the difference from the previous example):

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(cua-mode t nil (cua-base))
 '(tool-bar-mode nil nil (tool-bar)))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.

Interestingly, Emacs happily writes the .emacs file even if it is open at the time. You can watch Emacs change the file if you have it open when you choose Save Options.

Оглавление книги


Генерация: 1.297. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз