Tuesday, December 23, 2008

The Editors

Now we're up to the editors.

There are three editors I tend to use on a mac. Two of which I tend to use everywhere.

In order of use (with Linux equivalents):
  1. MacVim / GVim
  2. AquaEmacs / Emacs
  3. Textmate
Textmate I'm going to hold off on for a while. I don't often use it, and I'm a bit overwhelmed as it is.

Now installing these editors is not so cut and dried. I need to also install additional files so they can handle the various file formats I use. For example, django templating, actionscript, etc.

On the Vim side, here are the files I can get:

actionscript 3.0 and MXML

Now to make it work with MacVim takes a bit of quakery.

First off, where's the $VIMRUNTIME directory? Well, here's the hackery:

I read a snippet some where that said:

 :e $VIMRUNTIME/vimrc_example.vim
:saveas ~/.vimrc
:e $VIMRUNTIME/gvimrc_example.vim
:saveas ~/.gvimrc
So I did the first part, and then I tried "save as" to see which directory it was in. Turns out it's in:



go there, then "cd syntax" and you're where the *.vim files have to get dumped.

next do that above snippet of code to create a .vimrc file in your home directory. Not sure if you need to do the same gvimrc, but what the hell.

Now for Aquaemacs

First thing, check out this page on emacs customization. It will save you much pain.

There is a great site called emacswiki, it has a lot of a good info, especially on files you might like to install. I tend to use ecmascript (what actionscript is based on).

Here's a link for general info actionscript in emacs.
And another link for info on django in emacs.

Great, so how do I install this stuff in AquaEmacs? Here's how.

First, you have to install the *.el files in a place where emacs can find it. This all about the "load-path" and I found a great tip on this tutorial:

Where to put your elisp files

If you get an elisp file from the Internet or from a friend, you will need to put it in a place Emacs can find. Emacs needs to know this in case you want to load such a file from your .emacs. This is therefore the first thing I have in my .emacs file:

;;; Paths and directories
(add-to-list 'load-path "~/elisp")

next, you go to the aquamacs preferences file, and edit it like so:

(autoload 'ecmascript-mode "ecmascript-mode.el"
"Major mode for editing ecmascript." t)

(autoload 'actionscript-mode "actionscript-mode.el"
"Major mode for editing AS3 files." t)

(autoload 'django-html-mode "django-html-mode.el"
"'Improved' mode for editing django html templates." t)

(autoload 'django-mode "django-mode.el"
"Major mode for editing django templates." t)

(add-to-list 'auto-mode-alist '("\\.as[123]?$" . ecmascript-mode))

;; set tabs only
(setq-default indent-tabs-mode nil);
(setq default-tab-width 4);

(you don't have to add the tab settings) And you're done.

Next up, setting up iTunes.

No comments:

Post a Comment