Skip to content

Instantly share code, notes, and snippets.

@eightbitraptor
Created February 7, 2011 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eightbitraptor/814706 to your computer and use it in GitHub Desktop.
Save eightbitraptor/814706 to your computer and use it in GitHub Desktop.
my emacs init.el
(setq
elisp-path "~/.emacs.d/"
vendor-path "~/.emacs.d/vendor/")
;; Default Text Mode stuff
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)
(setq make-backup-files nil)
(setq-default save-place t)
;; Forward delete
(global-set-key [kp-delete] 'delete-char)
;; I'm a Ruby fascist - 2 space indent, no tabs
(setq-default indent-tabs-mode nil)
(setq standard-indent 2)
(setq-default show-trailing-whitespace 1)
;;highlight current line
(global-hl-line-mode -1)
;; initialize Ido Mode
(require 'ido)
(ido-mode t)
;; initialize Color Theme
(add-to-list 'load-path(concat vendor-path "color-theme"))
(require 'color-theme)
(color-theme-initialize)
(color-theme-dark-laptop)
;; initialize Textmate.el
(add-to-list 'load-path(concat vendor-path "textmate"))
(require 'textmate)
(textmate-mode)
(add-to-list 'load-path(concat vendor-path "yasnippet"))
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(setq yas/root-directory (concat vendor-path "yasnippet/snippets"))
(yas/load-directory yas/root-directory)
(setq yas/global-mode 1)
;; Initialise rinari
(add-to-list 'load-path(concat vendor-path "rinari"))
(require 'rinari)
;; loading custom emacs functions
(load "~/.emacs.d/personal/functions")
;; how to get less files highlighted in the same manner as css
(setq auto-mode-alist (cons '("\\.less$" . css-mode) auto-mode-alist))
;; how to get less files to compile to css format on save
(defun compile-less-css ()
"Compile LESS to CSS"
(interactive)
(if (string-match "\.less$" (buffer-file-name))
(async-shell-command (concat "lessc " (buffer-file-name)) nil nil)))
(add-hook 'after-save-hook 'compile-less-css)
;; add hook for using linum-mode only in ruby-mode
(add-hook 'ruby-mode-hook 'linum-mode)
;; Add line numbering for HTML mode
(add-hook 'html-mode-hook 'linum-mode)
;; Add line numbering in CSS mode
(add-hook 'css-mode-hook 'linum-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment