Created
June 23, 2010 23:50
-
-
Save jbr/450750 to your computer and use it in GitHub Desktop.
emacs config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; my ~/.emacs config as of Dec 1 | |
(setq load-path (cons "~/.emacs.d" load-path)) | |
(setq load-path (cons "~/.emacs.d/textmate.el" load-path)) | |
(setq load-path (cons "~/.emacs.d/color-theme-6.6.0" load-path)) | |
(setq load-path (cons "~/.emacs.d/magit" load-path)) | |
(when window-system | |
(set-default-font | |
(concat "-apple-Anonymous_Pro-" | |
"medium-normal-normal-" | |
"*-14-*-*-*-m-0-iso10646-1")) | |
(column-number-mode) | |
(require 'tabbar) | |
(require 'ide-skel) | |
(global-set-key "\M-[" 'ide-skel-toggle-left-view-window) | |
(global-set-key [(super \})] 'tabbar-forward) | |
(global-set-key [(super \{)] 'tabbar-backward) | |
(global-set-key [(super w)] 'kill-this-buffer) | |
(defun current-directory () | |
(or list-buffers-directory | |
(file-name-directory buffer-file-name))) | |
(defun ide-skel-sync-to-current-buffer () | |
(interactive) | |
(ide-skel-dir (current-directory)) | |
(ide-skel-show-left-view-window)) | |
(global-set-key "\C-\M-[" 'ide-skel-sync-to-current-buffer) | |
(require 'color-theme) | |
(require 'zenburn) | |
(zenburn) | |
(require 'textmate) | |
(setq textmate-use-file-cache nil) | |
(textmate-mode) | |
(require 'column-marker) | |
(add-hook 'find-file-hook | |
(lambda () | |
(interactive) | |
(column-marker-1 80))) | |
(require 'linum) | |
(global-linum-mode 1) | |
(menu-bar-mode -1) | |
(tool-bar-mode 0) | |
(setq mac-option-modifier 'meta)) | |
(require 'ido) | |
(ido-mode t) | |
(defalias 'yes-or-no-p 'y-or-n-p) | |
(setq-default truncate-lines t) | |
(show-paren-mode) | |
(setq make-backup-files nil | |
auto-save-default nil | |
inhibit-splash-screen t) | |
(autoload 'sass-mode "sass-mode" nil t) | |
(autoload 'haml-mode "haml-mode" nil t) | |
(autoload 'yaml-mode "yaml-mode" nil t) | |
(autoload 'textile-mode "textile-mode" nil t) | |
(autoload 'js2-mode "js2" nil t) | |
(autoload 'javascript-mode "javascript" nil t) | |
(autoload 'csv-mode "csv-mode" nil t) | |
(autoload 'ruby-mode "ruby-mode" nil t) | |
(autoload 'yaml-mode "yaml-mode" nil t) | |
(autoload 'coffee-mode "coffee-mode" nil t) | |
(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode)) | |
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) | |
(add-to-list 'auto-mode-alist '("\\.js.erb\\'" . javascript-mode)) | |
(add-to-list 'auto-mode-alist '("\\.haml\\'" . haml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.ya\?ml\\'" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode)) | |
(add-to-list 'auto-mode-alist '("\\.textile\\'" . textile-mode)) | |
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode)) | |
(add-to-list 'auto-mode-alist '("Rakefile\\'" . ruby-mode)) | |
(add-to-list 'auto-mode-alist '("\\.gemspec\\'" . ruby-mode)) | |
(add-to-list 'auto-mode-alist '("Gemfile\\'" . ruby-mode)) | |
(add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode)) | |
(add-to-list 'auto-mode-alist '("\\.coffee\\'" . coffee-mode)) | |
(defun mihai-indent () | |
"http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode" | |
(interactive) | |
(save-restriction | |
(widen) | |
(let* ((inhibit-point-motion-hooks t) | |
(parse-status (save-excursion (syntax-ppss (point-at-bol)))) | |
(offset (- (current-column) (current-indentation))) | |
(indentation (espresso--proper-indentation parse-status)) | |
node) | |
(indent-line-to indentation) | |
(when (> offset 0) (forward-char offset))))) | |
(defun indent-with-espresso () | |
"http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode" | |
(require 'espresso) | |
(setq espresso-indent-level 4 | |
indent-tabs-mode nil | |
c-basic-offset 4) | |
(set (make-local-variable 'indent-line-function) 'mihai-indent)) | |
(add-hook 'js2-mode-hook 'indent-with-espresso) | |
(global-set-key "\M- " 'hippie-expand) | |
(global-set-key "\M-;" 'comment-or-uncomment-region) | |
;; | |
;; the following two functions are from | |
;; http://sites.google.com/site/steveyegge2/my-dot-emacs-file | |
;; | |
(defun rename-file-and-buffer (new-name) | |
"Renames both current buffer and file it's visiting to NEW-NAME." | |
(interactive "sNew name: ") | |
(let ((name (buffer-name)) | |
(filename (buffer-file-name))) | |
(if (not filename) | |
(message "Bpuffer '%s' is not visiting a file!" name) | |
(if (get-buffer new-name) | |
(message "A buffer named '%s' already exists!" new-name) | |
(progn (rename-file name new-name 1) | |
(rename-buffer new-name) | |
(set-visited-file-name new-name) | |
(set-buffer-modified-p nil)))))) | |
(defun move-buffer-file (dir) | |
"Moves both current buffer and file it's visiting to DIR." | |
(interactive "DNew directory: ") | |
(let* ((name (buffer-name)) | |
(filename (buffer-file-name)) | |
(dir (if (string-match dir "\\(?:/\\|\\\\)$") | |
(substring dir 0 -1) dir)) | |
(newname (concat dir "/" name))) | |
(if (not filename) | |
(message "Buffer '%s' is not visiting a file!" name) | |
(progn (copy-file filename newname 1) | |
(delete-file filename) | |
(set-visited-file-name newname) | |
(set-buffer-modified-p nil) t)))) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(js2-allow-keywords-as-property-names t) | |
'(js2-basic-offset 2) | |
'(js2-bounce-indent-p t) | |
'(js2-cleanup-whitespace t) | |
'(js2-global-externs (list "$" "window")) | |
'(js2-mirror-mode nil) | |
'(js2-strict-missing-semi-warning nil) | |
'(ruby-deep-arglist nil)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(tabbar-button-highlight ((t (:inherit tabbar-button)))) | |
'(tabbar-default ((t (:inherit variable-pitch :background "gray82" :foreground "gray50" :height 0.8)))) | |
'(tabbar-highlight ((t nil))) | |
'(tabbar-selected ((t (:inherit tabbar-default :background "white" :foreground "blue" :box (:line-width 1 :color "black"))))) | |
'(tabbar-separator ((t (:inherit tabbar-default :height 0.2)))) | |
'(tabbar-unselected ((t (:inherit tabbar-default :background "gray72" :foreground "black" :box (:line-width 1 :color "black")))))) | |
(setq-default indent-tabs-mode nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment