Making Emacs More Firendly

I was messing around with Lisp the other day, and I started using Emacs (cause that just seemed like a right thing to do). This will probably offend the sensibilities of the die hard Emacs users, but when I set my editor into Cua mode, I noticed my actual productivity actually improved. Yeah, yeah, I know – blasphemy, and etc..

What does Cua mode do? Ok, remember when you installed Vim on Windoze and it came with the _vimrc file that binded Ctrl+C and Ctrl+V to copy and paste? Cua mode in Emacs is pretty much equivalent of that. It also let’s you highlight text with shift and arrows, and use Ctrl+Z to undo.

How do you enable it? Well, if your Emacs version is 22.1.1 or higher then you simply put:

(CUA-mode T)
(transient-mark-mode 1)
(setq cua-keep-region-after-copy T)

in your .emacs file. If not, you will need to get cua.el and drop it somewhere in your load path. then import it using:

(require 'cua)

Your millage may vary but this really made the editor more intuitive for me. In fact, I keep hearing about all those totally awesome things you can do with emacs, so this might just be the thing that will convince me to use the editor more often…

Now if I would just stop hitting Esc :w to save that would be great. ;)

[tags]emacs, cua mode, .emacs, editor[/tags]

This entry was posted in sysadmin notes and tagged . Bookmark the permalink.

10 Responses to Making Emacs More Firendly

  1. jambarama UNITED STATES K-Meleon Windows Terminalist says:

    Vi user myself (I’ve never gotten into lisp), but I can sympathize. I installed Cream, which makes Vi take “normal” shortcuts. This helped my productivity noticeably as well.

    Reply  |  Quote
  2. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux Terminalist says:

    Actually in vim I usually just dd or yank a line, and paste it with p. Otherwise I just copy and paste with the mouse. But I just didn’t feel like learning yet another way of copying and pasting for Emacs. :P

    Reply  |  Quote
  3. Ian Clifton UNITED STATES Mozilla Firefox Ubuntu Linux says:

    Noooo, don’t go to the dark side. Stay with Vim! If you start using emacs, your ctrl key will break ;)

    Also, you might want to double-check your title. It’s 75% correct :D

    Reply  |  Quote
  4. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux Terminalist says:


    I have also heard you can go blind if you emacs too much. :P

    Anyway, I’m planning to balance on the fine edge between the dark and the light side – vim is still my default text editor for almost everything, while I’m planning to use emacs for certain specialized tasks like Lisp… And maybe LaTex.

    Reply  |  Quote
  5. Jake UNITED STATES Mozilla Firefox Ubuntu Linux says:

    Well, I like Emacs well enough, but I’ve grown away from it during the last few months. I usually use Kate while under a GUI and jed under a terminal… jed is close enough to Emacs though, right?

    Reply  |  Quote
  6. ths UNITED KINGDOM Mozilla Firefox Windows Terminalist says:

    emacs was my standard editor on OS/2, when I was developing software with gcc. The C developer mode is so great and convenient, both when you call make, and when you use gdb to debug things.
    I think I made acquaintance with emacs at 18.51 in university, and on OS/2 I used em’s great port of 19.something.
    At work usually the unix OS people I have to rely on don’t bother installing anything else, so I have to stick with vi, and eventually I grow to like it (but I needed some years for this to happen).
    My bash/ksh command line is still in Emacs mode, not vi mode ;)

    Only recently I discovered the quite convenient subcommand “t” for “to” (delete to character, works like the “f” and “F”, e.g. d t % deletes upto and not including the next percent char).
    I’d still like to know how to switch on insert mode at column 1. “I” only inserts before the first non-whitespace; sometimes I definitely want to insert leftmost (e.g. a comment character).

    Reply  |  Quote
  7. Ian Clifton UNITED STATES Mozilla Firefox Ubuntu Linux says:

    @ths Try “gI” for inserting at the left most column

    Reply  |  Quote
  8. Luke Maciak UNITED STATES Mozilla Firefox Windows Terminalist says:

    I can confirm that, “gI” works. Thanks for that tip!

    Reply  |  Quote
  9. I have the opposite problem of trying to kill (C-k) and yank (C-y) lines outside of Emacs.

    Reply  |  Quote
  10. David UNITED KINGDOM Google Chrome Linux says:

    I had to use lower case:
    (cua-mode t)
    (transient-mark-mode 1)
    (setq cua-keep-region-after-copy t)

    but this works great, thanks

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *