Wednesday, January 23, 2008

HOWTO: Install CUA mode for cygwin emacs

Emacs is not comfortable due to its strange shortcuts for copying and pasting among all.

There is solution for those who prefer windows like shortcuts in emacs. It is called CUA-mode. It enables Ctrl-c, Ctrl-x, Ctrl-z, Ctrl-v copy/cut/undo/paste behaviour for selected text.

Current stable distribution of emacs under cygwin, 21.2.1, does not contain cua-mode built-in.

You have to install CUA manually to enable this behaviour under your cygwin emacs.

The steps are following:

  • 2) Save cua.el from bottom of the page in to the /usr/share/emacs/21.2/lisp/ cygwin path. (For my box it is C:\cygwin\usr\share\emacs\21.2\lisp\ )
  • 3) Edit your ~/.emacs file (from emacs or other editor you have ). Add following lines at the end of file:
    (require 'cua)
    (CUA-mode t)
  • 4) Restart emacs.

Enjoy.

No comments: