Skip to content

Instantly share code, notes, and snippets.

@danielevans
Last active December 14, 2015 15:08
Show Gist options
  • Save danielevans/5105465 to your computer and use it in GitHub Desktop.
Save danielevans/5105465 to your computer and use it in GitHub Desktop.
;; (setq ediff-make-buffers-readonly-at-startup t)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally)
;; Some custom configuration to ediff
(defvar my-ediff-bwin-config nil "Window configuration before ediff.")
(defcustom my-ediff-bwin-reg ?b
"*Register to be set up to hold `my-ediff-bwin-config'
configuration.")
(defvar my-ediff-awin-config nil "Window configuration after ediff.")
(defcustom my-ediff-awin-reg ?e
"*Register to be used to hold `my-ediff-awin-config' window
configuration.")
(defun my-ediff-bsh ()
"Function to be called before any buffers or window setup for
ediff."
(setq my-ediff-bwin-config (current-window-configuration))
(when (characterp my-ediff-bwin-reg)
(set-register my-ediff-bwin-reg
(list my-ediff-bwin-config (point-marker)))))
(defun my-ediff-ash ()
"Function to be called after buffers and window setup for ediff."
(setq my-ediff-awin-config (current-window-configuration))
(when (characterp my-ediff-awin-reg)
(set-register my-ediff-awin-reg
(list my-ediff-awin-config (point-marker)))))
(defun my-ediff-qh ()
"Function to be called when ediff quits."
(when my-ediff-bwin-config
(set-window-configuration my-ediff-bwin-config)))
(add-hook 'ediff-before-setup-hook 'my-ediff-bsh)
(add-hook 'ediff-after-setup-windows-hook 'my-ediff-ash 'append)
(add-hook 'ediff-quit-hook 'my-ediff-qh)
(add-hook 'ediff-load-hook
(lambda ()
(set-face-foreground
ediff-current-diff-face-A "#ffffff")
(set-face-background
ediff-current-diff-face-A "#6551d4")
(set-face-foreground
ediff-fine-diff-face-A "#ffffff")
(make-face-bold
ediff-fine-diff-face-A)
(set-face-background
ediff-fine-diff-face-A "#4026a9")
(set-face-background
ediff-odd-diff-face-A "#221122")
(set-face-foreground
ediff-odd-diff-face-A "#ffffff")
(set-face-foreground
ediff-current-diff-face-B "#ffffff")
(set-face-background
ediff-current-diff-face-B "#6551d4")
(set-face-foreground
ediff-fine-diff-face-B "#ffffff")
(make-face-bold
ediff-fine-diff-face-B)
(set-face-background
ediff-fine-diff-face-B "#4026a9")
(set-face-background
ediff-odd-diff-face-B "#221122")
(set-face-foreground
ediff-odd-diff-face-B "#ffffff")
(set-face-background
ediff-odd-diff-face-A "#221122")
(set-face-foreground
ediff-odd-diff-face-A "#ffffff")
(set-face-background
ediff-even-diff-face-B "#221122")
(set-face-foreground
ediff-even-diff-face-B "#ffffff")
(set-face-background
ediff-even-diff-face-A "#221122")
(set-face-foreground
ediff-even-diff-face-A "#ffffff")
))
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq css-indent-offset 2)
(setq js-indent-level 2)
(setq-default truncate-lines t)
(setq mac-option-modifier 'meta)
(setq make-backup-files nil)
;;(set-background-color "black")
;;(set-foreground-color "white")
(set-frame-height (selected-frame) 54)
(set-frame-width (selected-frame) 160)
(set-frame-position (selected-frame) 80 40)
(setq ns-pop-up-frames nil)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally)
(add-hook 'ediff-load-hook
(lambda ()
(set-face-foreground
ediff-current-diff-face-B "blue")
(set-face-background
ediff-current-diff-face-B "red")
(make-face-italic
ediff-current-diff-face-B)))
(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.
'(ruby-insert-encoding-magic-comment nil)
'(fringe-mode 0 nil (fringe))
'(inhibit-startup-screen t)
'(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 (:background "Black" :foreground "White" :height 140))))
'(cursor ((t (:background "#666"))))
'(mumamo-background-chunk-major ((((class color) (min-colors 88) (background dark)) (:background "default"))))
'(mumamo-background-chunk-submode1 ((((class color) (min-colors 88) (background dark)) (:background "#222")))))
(add-hook 'after-init-hook
(lambda () (setq debug-on-error nil)))
;; (add-hook 'ruby-mode-hook (lambda () (ruby-electric-mode t)))
;; (add-hook 'ruby-mode-hook (lambda () (local-set-key "\r" 'newline-and-indent)))
(require 'ido)
(ido-mode t)
;; (add-to-list 'load-path "~/.emacs.d/yasnippet")
;; (require 'yasnippet)
;; (yas/initialize)
;; (yas/load-directory "~/.emacs.d/yasnippet/snippets")
;; (yas/load-directory "~/.emacs.d/yasnippets-rails/rails-snippets")
;; (setq ri-ruby-script "/Users/wwe/.emacs.d/ri-emacs/ri-emacs.rb")
;; (load "/Users/wwe/.emacs.d/ri-emacs/ri-ruby.el")
;; (add-hook 'ruby-mode-hook (lambda () (local-set-key [\C-tab] 'ri-ruby-complete-symbol)))
;; (add-to-list 'load-path "~/.emacs.d")
;; (require 'p4)
;; (load-library "p4")
(load "~/personal/emacs/camelize.el")
;; (load "~/.emacs.d/nxhtml/autostart.el")
(load "~/personal/emacs/nxhtml/autostart.el")
(setq
nxhtml-global-minor-mode t
mumamo-chunk-coloring 'submode-colored
nxhtml-skip-welcome t
indent-region-mode t
rng-nxml-auto-validate-flag nil
nxml-degraded t)
(add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . eruby-nxhtml-mumamo-mode))
(add-to-list 'auto-mode-alist '("\\.jst.ejs\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.less\\'" . css-mode))
(add-to-list 'auto-mode-alist '("\\.scss\\'" . css-mode))
(load "~/personal/emacs/cucumber.el/feature-mode.el")
(load "~/personal/emacs/haml-mode/haml-mode.el")
(load "~/personal/emacs/yaml-mode/yaml-mode.el")
(add-to-list 'load-path "~/personal/emacs/magit")
;; (require 'magit)
;; change magit diff colors
(eval-after-load 'magit
'(progn
(set-face-foreground 'magit-diff-add "green3")
(set-face-foreground 'magit-diff-del "red3")
(set-face-background 'magit-item-highlight "#222")))
(load "~/personal/emacs/magit/magit.el")
(eval-after-load 'handlebars-mode
'(progn
(set-face-foreground 'handlebars-mode-section-face "cyan")
(set-face-foreground 'handlebars-mode-comment-face "red3")
(set-face-foreground 'handlebars-mode-include-face "cyan")
(set-face-foreground 'handlebars-mode-builtins-face "cyan")
(set-face-foreground 'handlebars-mode-variable-face "cyan")))
;;(load "~/personal/emacs/handlebars-mode/handlebars-mode.el")
(add-to-list 'load-path "~/personal/emacs/handlebars-mode/")
(require 'handlebars-mode)
;;(require 'mustache-mode)
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
(add-to-list 'auto-mode-alist '("\\Gemfile\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\Capfile\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\Rakefile\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\Guardfile\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rabl\\'" . ruby-mode))
(add-to-list 'load-path "/usr/local/Cellar/go/r60.3/misc/emacs" t)
(require 'go-mode-load)
;; (setq css-indent-offset 2)
;; (setq js-indent-level 2)
(setq make-backup-files nil)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(put 'downcase-region 'disabled nil)
(add-to-list 'load-path "~/personal/emacs/jshint-mode")
(require 'flymake-jshint)
(add-hook 'javascript-mode-hook
(lambda () (flymake-mode t)))
;; Turns on flymake for all files which have a flymake mode
(add-hook 'find-file-hook 'flymake-find-file-hook)
(defun what-face (pos)
(interactive "d")
(let ((face (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face))))
(if face (message "Face: %s" face) (message "No face at %d" pos))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment