I’ve been having issues with getting various modes to work in emacs and general bugginess recently. I never have time to really fix anything while I’m working so I sat down this Saturday morning and resolved to really try and clean it up. First of all, I decided to evaluate whether Aquamacs was really the best choice. I was somewhat forced into developing full-time on a Mac 4 years ago and although I’m a total convert now, at the time I made some quick decisions to get up and running immediately and Aquamacs was one of them. I loved the sane defaults and modern idioms it brought to emacs and I had very few complaints with it for the longest time. But I know some of the issues I’ve been having are unusual and in some cases I know they’re specific to Aquamacs and in other cases I strongly suspect they are based on reading other people’s experiences.

I very quickly discovered that emacs for Mac OSX has come a tremendously long ways since I plunged in 4 years ago and that it was very easy to switch back into regular emacs. I started here since the author appeared to be using a similar setup to mine. I hadn’t heard of Emacs starter kits or the ELPA and these are simply awesome. I think like most emacs users, I kind of stumble along, cutting-and-pasting googled snippets into my .emacs file. On occasion when I’ve tried to do heavy lisp coding, I’ve felt my mind slowly going insane. Lisp is a fine language… aesthetically… from afar. It’s just not for me.

I quickly decided to follow Marc Bowes example and start from scratch, forked his emacs starter kit as a starting point and got to work. I found that all the things I liked about Aquamacs were easy to obtain for vanilla emacs. I could finally get eruby’s mumamo mode to run without issues. I turned off chuck background colours as I was used to with

setq mumamo-background-colors nil

I found that the emacs starter kit included a windmove module that makes the shift-arrow keys switch buffers. This is actually probably pretty useful. The normal emacs switch window keybind, Ctrl-x o, is cumbersome. But I’m so used to it, I’d rather have shift-move mean select as it does in every editor in existence and as it does in Aquamacs by default. This proved to be simple. I commented out the windmove module in the starter-kit-bindings and installed shift-select-mode from ELPA.

I also found ido-mode was included in the starter kit by default. I’ve gave ido-mode a pretty fair try once and hated it. But now I think I may have either not spent enough time customizing it or ran into limitations in Aquamacs using it and decided to give it another shake. There are some things that still seem annoying but I discovered that I can turn it off quickly during file commands by repeating Ctrl-f, and that I could turn off the useless find-file-at-point defaults included. There are definitely some very nice things in it, and combined with recentf, it’s got a lot of potential for efficiency.

I carried over a few other basic alterations that I had grown used to, and added a new one: rigid indent keybinds. I know, I know you’re supposed to just type C-u -2 C-x tab…. It’s shit like that that keeps newcomers away from emacs. So I just wrote this:

(define-key global-map \[\C-tab\] 'indent-rigidly)
(define-key global-map \[\C-\S-tab\] 'indent-rigidly-back)
(defun indent-rigidly-back () (interactive) (indent-rigidly (region-beginning) (region-end) -1))

I also installed aspell from homebrew and plugged it into flyspell. I’m writing this blog post in emacs with auto-spellcheck working (apparently) for the first time ever. I had tried it before but had flakiness with it that made me abandon it. I’m also trying out auto-complete again. I loved it but again… flakiness in Aquamacs.

It also feels really weird to abandon my good old dot-emacs file. It’s been with me in some form or another for 15 years. But it really is the digital equivalent of that old, stained T-shirt from high school that you just can’t get rid of. It’s marked up with stuff from PuTTY, SecureCRT, commented out blocks of stuff that was buggy or that I never got around to using. Here’s my shiny new clean set of init scripts and I’m using the following elpa packages:

  • auto-complete
  • findr
  • flymake-cursor
  • flymake-easy
  • flymake-jslint
  • flymake-phpcs
  • flymake-ruby
  • flymake-sass
  • inf-ruby
  • inflections
  • js2-mode
  • jump
  • magit
  • popup
  • rinari
  • ruby-compilation
  • yaml-mode
  • yasnippet-bundle


blog comments powered by Disqus

Published

02 February 2013

Tags