emacs css-mode indent-buffer fix
Ive been using emacs for some years now, but I always noticed the css mode seemed to format it a little strange.
I found this article, it fixes all the issues in the css mode.
(setq cssm-indent-level 4) (setq cssm-newline-before-closing-bracket t) (setq cssm-indent-function #'cssm-c-style-indenter) (setq cssm-mirror-mode nil)
Now when I auto indent the buffer it looks correctly. I have no idea why this is not the default for the css-mode.
FYI my auto indent key is F2.
(defun indent-buffer () (interactive) (save-excursion (indent-region (point-min) (point-max) nil)) ) (global-set-key [f2] 'indent-buffer)
March 29th, 2008 at 8:50 pm
The CSS Mode has been improved in the new emacs 22.2 (came out on March 26th 2008). Now its really good!
December 25th, 2008 at 9:24 pm
That’s great helpful information. This is what I was looking for. Thank you for sharing and the “this” link was broken, BTW.
Thanks,
January 21st, 2009 at 6:36 am
[…] to stokebloke.com for saving my sanity. Leave a […]
February 18th, 2009 at 9:23 pm
Thanks!!
October 29th, 2009 at 2:52 pm
[…] and posted a fix, which he himself found on another blog post by Chris Miller, which Chris in turn found on StokeBloke.com which had been found originally on a now dead […]
September 9th, 2011 at 8:21 pm
I’m running ubuntu with emacs 23.2 and emacs-mode package 0.11-7 and STILL had insane tabs when it came to css. This snippet did the trick for me.
The mapping of auto indenting to a button was also a good idea.
Thanks!
June 14th, 2012 at 5:47 am
[…] From Here […]
October 12th, 2012 at 6:11 pm
[…] Stokebloke […]