Recipe: Bearable Emacs
March 25, 2009 by Amr
This post is for those who might be planning on trying emacs (for the first time soon), or are just starting their way with emacs and could use a tip or two from a fellow starter.
After I installed emacs I was horrified by its unbearable look which I thought would have changed over the few last years since I last tried it. Luckily the CVS version of emacs has considerable improvements in that area, it looks much better and I've been using it for few days and it seems to be pretty stable.
Installation
Assuming you are using Debian or Ubuntu, you would start by installing the snapshot package for emacs:
$ sudo apt-get install emacs-snapshot-gtk emacs-goodies-elIf you are not using a debian-based distro. Then your options are to either find a package in your distro compiled from the CVS version of emacs, or compile it yourself. Since I've not compiled it myself, I'm unable to provide specific instructions here. However, you can find external resources on that in the related links. We also installed
emacs-goodies-elwhich contains additional add-on packages (in emacs lisp).If you had the default emacs package installed already, you will want to set emacs-snapshot as the default instead:
$ sudo update-alternatives --config emacs $ sudo update-alternatives --config emacsclientFont
I chose to use the FLOSS font Inconsolata, which is a work in progress by Ralph Levien. You can of course use any font you would like:
$ mkdir ~/.fonts # .fonts is a per-user font directory # recognized by fontconfig $ mv Inconsolata.otf ~/.fonts/ $ fc-cache -fv # update fontconfig cache $ echo "emacs.font: Inconsolata-12" >> ~/.Xresources $ xrdb ~/.XresourcesColor theme
I don't like dark color themes, or that's what I thought until I tried wombat, a dark color theme for ehm... vim. I've been using it in vim for more than a year and never looked back. A quick look at the default color themes for emacs which come part of the color-theme package, I knew I'd need wombat. Lucky me, someone had done all the work into making an emacs equivalent of wombat. So I took that, made a
color-theme.elcompatible file out of it by usingcolor-theme-print.So assuming you would like to use wombat as well, get
color-theme-wombat.eland place it in your~/.emacs.d/and start your~/.emacsstruggle by adding this elisp:; Add ~/.emacs.d to load-path (add-to-list 'load-path "~/.emacs.d") ; Use wombat theme (require 'color-theme-wombat) (color-theme-wombat)If you don't like wombat, try having a look at the 50+ color themes which come with color-theme package using
M-x color-theme-select.At this point, your emacs should look like this:
What else?
Now that was as far as I could go for the looks. So fire up emacs already,
C-x C-f ~/.emacs RETand get your.emacsstruggle going.I've attached my
.emacsas well as the .el(s) I created myself which you won't find else where. It's moderately commented so you may be able to understand what the hell I'm trying to do with each line and maybe like and use them too. For the additional .el files I've wrote a description of each.Possibly of particular interest to ex-vim users like myself, is the vim-emacs cheatsheet. Download it and put it along the
toggle-vim-emacs.elfile in your~/.emacs.ddirectory, and add this to your.emacs:(require 'toggle-vim-emacs) (global-set-key [f12] 'toggle-vim-emacs)Now whenever you get stuck trying to do something which you already knew how to do in vim, hit
F12and look it up. HitF12to toggle it back off.
Final random notes
- Bleeding edge is cool?
- You might as well pull a weekly snapshot deb from the PPA for Ubuntu Emacs Lisp which is building it from Romain's Debian Emacs Snapshots
- Devil's Pie
- Use it with gdevilspie and you can control the window properties of emacs on startup (like having it maximize, or use workspace 2, ...etc), in less than a minute.
- Are you a Drupal contributer?
- Then you might find the handbook page on configuring emacs for drupal useful. All of it is included in the file
setup-php.elfile. Though depending on when are you reading this post, the handbook page will most likely be more updated thansetup-php.elas I will continue adding bits and pieces there, not here.
Comments
Apologies
June 14, 2009 by Amr, 1 year 6 weeks ago
Comment id: 1068
Apologies to the original commenters on this post as it the post was lost along with my whole blog, and the original post text was all I could retrieve.
Post new comment