Skip to content

Instantly share code, notes, and snippets.

@roycyt
Forked from ianb/.emacs.el
Created February 27, 2014 12:26
Show Gist options
  • Save roycyt/9249142 to your computer and use it in GitHub Desktop.
Save roycyt/9249142 to your computer and use it in GitHub Desktop.
(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.
'(auto-save-file-name-transforms (quote (("\\`/[^/]*:\\(.+/\\)*\\(.*\\)" "/Users/ianbicking/.emacs-saves/autosave"))))
'(backup-directory-alist (quote ((".*" . "/Users/ianbicking/.emacs-saves/backup/"))))
'(delete-old-versions t)
'(flymake-allowed-file-name-masks (quote (("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init) ("\\.cs\\'" flymake-simple-make-init) ("\\.p[ml]\\'" flymake-perl-init) ("\\.php[345]?\\'" flymake-php-init) ("\\.h\\'" flymake-master-make-header-init flymake-master-cleanup) ("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup) ("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup) ("\\.tex\\'" flymake-simple-tex-init) ("\\.idl\\'" flymake-simple-make-init))))
'(frame-background-mode (quote dark))
'(grep-command "grep -n -E -e ")
'(grep-find-command "find . -not -path '*svn*' -not -path '*.pyc' -type f -print0 | xargs -0 -e grep -n -e ")
'(indent-tabs-mode nil)
'(js-auto-indent-flag nil)
'(js-expr-indent-offset 2)
'(js-indent-level 2)
'(js2-allow-keywords-as-property-names t)
'(js2-cleanup-whitespace t)
'(js2-global-externs (quote (JSON Components console XPCOMUtils XMLHttpRequest localStorage setTimeout setInterval clearTimeout atob btoa)))
'(js2-include-gears-externs nil)
'(tab-width 4)
'(tool-bar-mode 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.
'(default ((t (:inherit nil :stipple nil :background "#000044" :foreground "White" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "apple" :family "Monaco"))))
'(js2-function-param-face ((t (:foreground "#afa"))))
'(js2-instance-member-face ((t (:foreground "#f7f"))))
'(trailing-whitespace ((((class color) (background dark)) (:background "Black")))))
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
(setq exec-path
'(
"/Users/ianbicking/bin"
"/usr/bin"
"/bin"
"/usr/sbin"
"/sbin"
"/usr/local/bin"
"/usr/local/sbin"
"Users/ianbicking/.gem/ruby/1.8/bin"
))
(setq load-path (cons "/Users/ianbicking/.emacs.d" load-path))
(load-library "doctest-mode")
(load-library "coffee-mode")
(add-hook 'html-mode-hook 'turn-off-auto-fill)
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward)
(setq tab-stop-list '(4 8 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 83 88 92 96 100 104))
;(require 'session)
;(add-hook 'after-init-hook 'session-initialize)
(setq javascript-auto-indent-flag nil)
(setq require-final-newline t)
(setq js2-bounce-indent-p nil)
(setq js2-auto-indent-flag nil)
(setq javascript-indent-level 0)
(require 'vi-indent)
(setq indent-tabs-mode nil)
(load "php-mode")
(load "markdown-mode")
(add-to-list 'auto-mode-alist
'("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode))
(autoload 'js2-mode "js2-mode" nil t)
(autoload 'less-css-mode "less-css-mode" nil t)
(require 'less-css-mode)
(require 'js2-mode)
(add-hook 'js-mode-hook 'js2-minor-mode)
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("\\.yaml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("src/thecutout-site/.*\\.txt" . rst-mode))
;(add-to-list 'auto-mode-alist '("src/thecutout-site/.*\\.txt" . longlines-mode))
(add-to-list 'auto-mode-alist '("src/towtruck/.*\\.tmpl" . html-mode))
(add-to-list 'auto-mode-alist '(".*\\.less" . less-mode))
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-hook 'before-save-hook 'delete-trailing-blank-lines)
(defun goto-start-of-last-line ()
"Moves the point to the start of the line line in the buffer"
(goto-line (+ (count-lines (point-min) (point-max)) 1))
(beginning-of-line))
(defun delete-trailing-blank-lines ()
"Deletes all blank lines at the end of the file. These must be
truely blank and contain no whitespace."
(interactive)
(save-excursion
(progn
(goto-start-of-last-line)
(delete-blank-lines))))
(when (load "flymake" t)
(defun flymake-pylint-init (&optional trigger-type)
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name)))
(options (when trigger-type (list "--trigger-type" trigger-type))))
(list "~/.emacs.d/flymake-python/pyflymake.py" (append options (list local-file)))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py" flymake-pylint-init)))
(add-hook 'find-file-hook 'flymake-find-file-hook)
(add-to-list 'load-path "~/.emacs.d/jshint-mode")
(require 'flymake-jshint)
(add-hook 'javascript-mode-hook
(lambda () (flymake-mode t)))
(global-set-key "\C-x\C-o" 'other-window)
(global-set-key "\C-c>" 'indent-code-rigidly)
(global-set-key "\C-c<" 'py-shift-region-left)
(global-set-key "\C-c\C-g" 'grep-find)
(global-set-key [?\C-x ?\C-1] 'delete-other-windows)
(global-set-key [?\C-x ?\C-2] 'split-window-vertically)
(global-set-key [M-up] 'backward-paragraph)
(global-set-key [M-down] 'forward-paragraph)
(global-set-key [C-prior] 'beginning-of-buffer)
(global-set-key [C-next] 'end-of-buffer)
(global-set-key [C-tab] 'other-window)
(global-set-key [M-s] 'search-forward-regexp)
(global-set-key [M-r] 'search-backward-regexp)
(global-set-key "\M-g" 'goto-line)
(global-set-key [s-backspace] 'backward-kill-word)
(global-set-key (kbd "C-w") 'backward-kill-word)
(global-set-key (kbd "C-c k") 'kill-region)
(global-set-key "\C-w" 'clipboard-kill-region)
(global-set-key "\M-w" 'clipboard-kill-ring-save)
(global-set-key "\C-y" 'clipboard-yank)
(global-set-key (kbd "C-c e") 'flymake-display-err-menu-for-current-line)
(global-set-key (kbd "C-c C-e") 'flymake-display-err-menu-for-current-line)
(global-set-key (kbd "C-c n") 'flymake-goto-next-error)
(global-set-key "\C-m" 'newline-and-indent)
(define-key js2-mode-map [tab] 'vi-tab-to-next-stop)
(define-key js2-mode-map [backtab] 'vi-backtab-to-previous-stop)
(define-key js2-mode-map [(meta tab)] 'vi-indent-line)
(define-key js2-mode-map [return] 'vi-newline-and-indent)
(define-key js2-mode-map ";" 'self-insert-command)
(define-key js2-mode-map "(" 'self-insert-command)
(define-key js2-mode-map "[" 'self-insert-command)
(define-key js2-mode-map "{" 'self-insert-command)
(define-key js2-mode-map "'" 'self-insert-command)
(define-key js2-mode-map "," 'self-insert-command)
(define-key js2-mode-map ":" 'self-insert-command)
(setq ispell-program-name "/usr/local/bin/ispell")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment