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.
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-el
If 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-el which 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 emacsclient
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 ~/.Xresources
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.el compatible file out of it by using color-theme-print.
So assuming you would like to use wombat as well, get color-theme-wombat.el and place it in your ~/.emacs.d/ and start your ~/.emacs struggle 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:
Now that was as far as I could go for the looks. So fire up emacs already, C-x C-f ~/.emacs RET and get your .emacs struggle going.
I've attached my .emacs as 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.el file in your ~/.emacs.d directory, 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 F12 and look it up. Hit F12 to toggle it back off.
setup-php.el file. Though depending on when are you reading this post, the handbook page will most likely be more updated than setup-php.el as I will continue adding bits and pieces there, not here.
Comments
Apologies
June 14, 2009 by Amr, 34 weeks 1 day 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