emacs & css-mode

Originally posted on October 28th, 2005 on another blog, here is how to obtain css-mode running in emacs.

Windows users

Download the css-mode from the site and copy the css-mode.el file into the $EMACS_INSTALL_DIR/site-lisp (in my case it’s C:\Programs Files\emacs-21.3\site-lisp.

Debian users

Install the css-mode package: #aptitude install css-mode. If you want to use the original (not Debian packaged) sources, the directory where to copy the .el file is /usr/share/emacs/site-lisp.

Configuration

In your ~/.emacs add the following lines

(autoload 'css-mode "css-mode")
(setq auto-mode-alist
   (cons '("\.css\'" . css-mode) auto-mode-alist))

If you prefer the C/C++ indentation style also add the line

(setq cssm-indent-function #'cssm-c-style-indenter)

finally obtaining

(autoload 'css-mode "css-mode")
(setq auto-mode-alist
   (cons '("\.css\'" . css-mode) auto-mode-alist))
(setq cssm-indent-function #'cssm-c-style-indenter)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s