Skip to content

Instantly share code, notes, and snippets.

@nominolo
Created February 24, 2015 07:20
Show Gist options
  • Save nominolo/9951e08799069830f84c to your computer and use it in GitHub Desktop.
Save nominolo/9951e08799069830f84c to your computer and use it in GitHub Desktop.
Emacs config
(deftheme golden-braid
"Created 2013-09-16.")
(custom-theme-set-faces
'golden-braid
'(cursor ((t (:background "yellow" :inverse-video t))))
'(fixed-pitch ((t (:family "courier"))))
'(variable-pitch ((t (:family "helv"))))
'(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
'(minibuffer-prompt ((t (:weight bold :foreground "yellow" :background "red"))))
'(highlight ((t (:background "gray10"))))
'(region ((((class color) (min-colors 88) (background dark)) (:background "black")) (((class color) (min-colors 88) (background light) (type gtk)) (:background "gtk_selection_bg_color" :foreground "gtk_selection_fg_color")) (((class color) (min-colors 88) (background light) (type ns)) (:background "ns_selection_color")) (((class color) (min-colors 88) (background light)) (:background "lightgoldenrod2")) (((class color) (min-colors 16) (background dark)) (:background "black")) (((class color) (min-colors 16) (background light)) (:background "lightgoldenrod2")) (((class color) (min-colors 8)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray"))))
'(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow"))))
'(secondary-selection ((((class color) (min-colors 88) (background light)) (:background "yellow1")) (((class color) (min-colors 88) (background dark)) (:background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:background "yellow")) (((class color) (min-colors 16) (background dark)) (:background "SkyBlue4")) (((class color) (min-colors 8)) (:foreground "black" :background "cyan")) (t (:inverse-video t))))
'(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t))))
'(font-lock-builtin-face ((t (:foreground "#9065cc"))))
'(font-lock-comment-delimiter-face ((t (:inherit (font-lock-comment-face)))))
'(font-lock-comment-face ((t (:foreground "gray48"))))
'(font-lock-constant-face ((t (:foreground "gold"))))
'(font-lock-doc-face ((t (:background "gray16" :foreground "gray60"))))
'(font-lock-function-name-face ((t (:foreground "gold" :inherit (default)))))
'(font-lock-keyword-face ((t (:foreground "Gray50"))))
'(font-lock-negation-char-face ((t nil)))
'(font-lock-preprocessor-face ((t (:inherit font-lock-keyword-face))))
'(font-lock-regexp-grouping-backslash ((t (:weight bold :inherit (bold)))))
'(font-lock-regexp-grouping-construct ((t (:weight bold :inherit (bold)))))
'(font-lock-string-face ((t (:background "grey17" :foreground "grey60"))))
'(font-lock-type-face ((t (:foreground "DarkOrange2"))))
'(font-lock-variable-name-face ((t (:foreground "#ffaa33"))))
'(font-lock-warning-face ((t (:weight bold :foreground "Pink" :inherit (error)))))
'(button ((t (:inherit link :background "grey15" :foreground "grey60" :box (:line-width 2 :color "grey15" :style released-button) :underline t :weight bold))))
'(link ((((class color) (min-colors 88) (background light)) (:underline t :foreground "RoyalBlue3")) (((class color) (background light)) (:underline t :foreground "blue")) (((class color) (min-colors 88) (background dark)) (:underline t :foreground "cyan1")) (((class color) (background dark)) (:underline t :foreground "cyan")) (t (:inherit (underline)))))
'(link-visited ((t (:underline t :foreground "violet" :inherit (link)))))
'(fringe ((t (:background "grey15"))))
'(header-line ((t (:height 0.9 :box (:line-width -1 :color "grey20" :style released-button) :foreground "grey90" :background "grey20" :inherit (mode-line)))))
'(tooltip ((t (:family "helv" :foreground "black" :background "lightyellow" :inherit (variable-pitch)))))
'(mode-line ((t (:background "grey10" :foreground "grey90" :box (:line-width 1 :color "grey40" :style released-button) :height 0.9))))
'(mode-line-buffer-id ((t (:height 0.9 :weight bold :foreground "yellow"))))
'(mode-line-highlight ((t (:box (:line-width 2 :color "grey40" :style released-button)))))
'(mode-line-inactive ((t (:inherit mode-line :background "grey20" :foreground "grey60" :box (:line-width 1 :color "grey20" :style released-button) :weight light :height 0.9))))
'(ido-first-match ((t (:underline t))))
'(ido-only-match ((t (:foreground "YellowGreen" :underline t))))
'(ido-indicator ((t (:background "red1" :foreground "yellow1" :width condensed))))
'(magit-item-highlight ((t (:inherit nil :background "gray15"))))
'(magit-diff-add ((t (:foreground "green4"))))
'(magit-diff-del ((t (:foreground "OrangeRed"))))
'(isearch ((((class color) (min-colors 88) (background light)) (:foreground "lightskyblue1" :background "magenta3")) (((class color) (min-colors 88) (background dark)) (:foreground "brown4" :background "palevioletred2")) (((class color) (min-colors 16)) (:foreground "cyan1" :background "magenta4")) (((class color) (min-colors 8)) (:foreground "cyan1" :background "magenta4")) (t (:inverse-video t))))
'(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t))))
'(lazy-highlight ((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) (((class color) (min-colors 16)) (:background "turquoise3")) (((class color) (min-colors 8)) (:background "turquoise3")) (t (:underline t))))
'(match ((((class color) (min-colors 88) (background light)) (:background "yellow1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray"))))
'(next-error ((t (:background "blue3" :inherit (region)))))
'(query-replace ((t (:foreground "brown4" :background "palevioletred2" :inherit (isearch)))))
'(bold ((t (:foreground "white"))))
'(diff-added ((t (:foreground "green4"))))
'(diff-removed ((t (:foreground "OrangeRed"))))
'(default ((t (:family "Inconsolata" :foundry "apple" :width normal :height 160 :weight normal :slant normal :underline nil :overline nil :strike-through nil :box nil :inverse-video nil :foreground "grey70" :background "grey20" :stipple nil :inherit nil))))
;;'(default ((t (:family "Anka/Coder Narrow" :foundry "apple" :width normal :height 160 :weight normal :slant normal :underline nil :overline nil :strike-through nil :box nil :inverse-video nil :foreground "grey70" :background "grey20" :stipple nil :inherit nil))))
'(scion-error-face ((t (:background "#933"))))
'(scion-warning-face ((t (:background "#663"))))
'(compilation-info ((t (:foreground "#7cf"))))
'(mode-line ((t (:background "grey10" :foreground "grey90" :box (:line-width 1 :color "grey40" :style released-button) :height 0.9))))
'(org-code ((t (:foreground "#738ffe"))))
'(org-done ((t (:foreground "Green3" :weight bold))))
'(org-link ((t (:foreground "#b3e5fc"))))
'(org-todo ((t (:foreground "red3" :weight bold))))
'(outline-3 ((t (:foreground "DarkOrange"))))
'(shadow ((t (:foreground "grey40"))))
)
(provide-theme 'golden-braid)
(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-default t)
'(auto-save-file-name-transforms
(quote
(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" "/tmp/\\2" nil)
(".*" "~/tmp/emacs_autosaves/\\2" t))))
'(backup-by-copying t)
'(backup-directory-alist (quote (("." . "~/tmp/emacs_backups/"))))
'(blink-cursor-mode nil)
'(column-number-mode t)
'(completion-ignored-extensions
(quote
(".o" "~" ".bin" ".lbin" ".so" ".a" ".ln" ".blg" ".bbl" ".elc" ".lof" ".glo" ".idx" ".lot" ".svn/" ".hg/" ".git/" ".bzr/" "CVS/" "_darcs/" "_MTN/" ".fmt" ".tfm" ".class" ".fas" ".lib" ".mem" ".x86f" ".sparcf" ".dfsl" ".pfsl" ".d64fsl" ".p64fsl" ".lx64fsl" ".lx32fsl" ".dx64fsl" ".dx32fsl" ".fx64fsl" ".fx32fsl" ".sx64fsl" ".sx32fsl" ".wx64fsl" ".wx32fsl" ".fasl" ".ufsl" ".fsl" ".dxl" ".lo" ".la" ".gmo" ".mo" ".toc" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs" ".pyc" ".pyo" ".hi" ".lcbc")))
'(create-lockfiles nil)
'(custom-enabled-themes (quote (golden-braid)))
'(custom-safe-themes
(quote
("1954b300c6500bc03cf78261459f1b2e7a03b4f173cc87588532fdf5c2975de6" "ee72d8e425c71efe326341aa289a3df871924505077f3f912e664c51980c7ff4" "62aecdb3f9f9d864a8afc143b50e6f30a44c73f79c1353cec2f3edbe34751c1c" "2d7b5ee283ddd13dd22a088e7868cdcf8f10dc3ff8c6f9e37f5972fe611bf531" "eecfe943ad2ee394714c64453d38a725704ba9494e850767f3884bc65c5d2278" "814973787329fe36147ab7206cb321516251acfc00eb89ed38d9a7375a92042f" "4651d98f2a7121e4bf17e716bd01a2c3f1acc4fd077d10806621855a18fa32a6" "89ec6ca0c1467ed26d917d032355284d748ef2be2fc451a278fa029229ced7ac" "11aaef22036722020b5336a1d4040776862afcfbbe972abe3d1b704356198918" "62637669db8a1b535cf74a4f196b54f0e61106c0db4e4761d46c0e88ccdba47b" "177146fe7a9d64e1cbe0966076e66b46408a60cc99547f9fdc7f227ef3ba78b1" "17aff952676165a6b0a7311f3663e48baadeead4c80a38217f8db36a91f3144d" "e430e061346ede80fa00e740fecccf79f97bc1395dd3890100a90247f23fa3c8" "ce329a719ded695f34dab4ecd2fa978727db6cc46a0a3ba010bc1f5cf55e93ec" "ad26183d963924b9a121aa1824350ef3a4562bd4af18bde33d94803e179bd28d" "8952dfeb95aef2f2a2ed18e9de616657926739464f26c182f4821e34adbb9745" "035009b88c234d4d95fb180be76bedb8e78abbca5aa15cfe1d33a5541a4a39c2" "6c927ba708ed461c3702c08a5628eee64ec9490309c382a3a364928ce57fed4a" "697320c742c877f7f5581a9f4738432900ef1526e1c3aa3bb1c6087b7035b522" "5a3be4db73b83c0cc657ff8e4aff402f9bf2b80ceb897eb9aa72fe82c54b6255" "9a54e1025213c89c2ec8ee84804bfbb01804c37a07d8c0f0a58401909b84c752" "e2b1bce48dcbf8eefaf83162e9c83010cfcd4a195fd30f7498d63776ba88722b" "95a2ec0e976aebb6c433b178331ed5cdf85c94d5b1a833c420de149b5d786dc5" "fa0be641c2c8056b43bc6ad8e4735094253e69089fd14999e8564f9636b854d4" "cb33a5bd5e3f810c594b0f522bcce6c8ffd936429a555088917945925eee71b8" "4f994e8cb4602134183a0e9d7d8910968ae3357ba1b17f6ea049b77065fe1fb0" "674adc269b099ffcaf99d6dae94ac8698771ea8cf7ef95d177724f89a0d6e1cf" "00d4db145623edb38e3619163bebb51d5c8e9643fa621d39857b002b44f16832" "709276d59da5ac85d04adf7aaf851c4d66a3febf7af55f16542a0aed0cc8475a" "eb0724c2cf6df34c1de4459755cadb051d0427125ef9cd56a865a0944e822df8" "8f21f8a0f8cc48c917806aa5dacca78c49ece70639d2803424fe0b7f861fc832" "4c05381c0d270f4073cda4cb1a6a20ee6c548d0b4ae815040b48679b9eac06c8" default)))
'(flymake-no-changes-timeout 1000)
'(haskell-process-args-ghci (quote ("-ferror-spans")))
'(haskell-process-path-ghci "cabal repl")
'(indent-tabs-mode nil)
'(scroll-bar-mode nil)
'(show-paren-mode t)
'(tool-bar-mode nil)
'(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify)))
(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.
'(company-scrollbar-bg ((t (:inherit company-tooltip :background "grey30"))))
'(company-scrollbar-fg ((t (:background "grey40"))))
'(company-tooltip ((t (:background "grey30" :foreground "grey70"))))
'(company-tooltip-annotation ((t (:inherit company-tooltip :foreground "orange2"))))
'(company-tooltip-common ((t (:inherit company-tooltip :foreground "yellow"))))
'(company-tooltip-common-selection ((t (:inherit company-tooltip-selection :foreground "yellow1"))))
'(company-tooltip-selection ((t (:inherit company-tooltip :background "black" :foreground "white"))))
'(compilation-info ((t (:foreground "#7cf"))))
'(font-lock-constant-face ((t (:foreground "lightgoldenrod3"))))
'(font-lock-doc-face ((t (:inherit font-lock-comment-face :background "gray20" :foreground "gray60"))))
'(mode-line ((t (:background "grey10" :foreground "grey90" :box (:line-width 1 :color "grey40" :style released-button) :height 0.9))))
'(org-code ((t (:foreground "#738ffe"))))
'(org-done ((t (:foreground "Green3" :weight bold))))
'(org-link ((t (:foreground "#a3d4fc"))))
'(org-todo ((t (:foreground "red3" :weight bold))))
'(outline-3 ((t (:foreground "DarkOrange"))))
'(shadow ((t (:foreground "grey40"))))
'(trailing-whitespace ((t (:background "red4"))))
'(whitespace-empty ((t (:background "#322" :foreground "firebrick"))))
'(whitespace-line ((t (:background "#322")))))
;; '(diff-added ((t (:foreground "green4"))))
;; '(diff-removed ((t (:foreground "OrangeRed"))))
;; '(flymake-errline ((t (:background "#633"))))
;; '(header-line ((t (:inherit mode-line :background "grey22" :foreground "grey90" :box (:line-width -1 :color "grey20" :style released-button) :height 0.9))))
;; '(magit-item-highlight ((t (:background "gray15"))))
;; '(match ((t (:background "SlateBlue3"))))
;; '(outline-3 ((t (:inherit font-lock-type-face))))
;; '(outline-4 ((t (:foreground "#d50"))))
;; '(scion-error-face ((t (:background "#933"))))
;; '(scion-warning-face ((t (:background "#663"))))
;; '(sh-heredoc ((t (:inherit font-lock-string-face))))
;; '(show-paren-match ((t (:background "slateblue3")))))
(load-theme 'golden-braid t)
(defun toggle-fullscreen ()
(interactive)
(if (fboundp 'ns-toggle-fullscreen)
(ns-toggle-fullscreen)
(set-frame-parameter nil 'fullscreen
(if (frame-parameter nil 'fullscreen)
nil
'fullboth))))
(global-set-key [(meta super return)] 'toggle-fullscreen)
(global-set-key [home] 'move-beginning-of-line)
(global-set-key [end] 'move-end-of-line)
(global-set-key [(control tab)] 'other-window)
(ido-mode 1)
;; Bind standard OSX bindings to something sensible
(global-set-key [(super w)] 'kill-this-buffer)
(global-set-key [(super t)] 'ido-switch-buffer)
(global-set-key [(super o)] 'ido-find-file)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/")
)
(package-initialize)
;; TODO: evaluate haskell-mode from melpa, projectile, s, yaml-mode,
;; evil, lua-mode, markdown-mode
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
;; (progn (set-frame-parameter nil 'fullscreen 'nil)
;; (set-frame-parameter nil 'fullscreen 'fullboth))
(require 'magit)
(global-set-key [f8] 'magit-status)
(require 'windmove)
(global-set-key [(meta super left)] 'windmove-left)
(global-set-key [(meta super right)] 'windmove-right)
(global-set-key [(meta super up)] 'windmove-up)
(global-set-key [(meta super down)] 'windmove-down)
;; We need to set both the unix variable $PATH as well as Emacs's
;; version of it "exec-path"
(setenv "PATH" "/usr/local/bin:/usr/texbin:/usr/local/share/npm/bin:$PATH" t)
(push "/usr/local/share/npm/bin" exec-path)
(push "/usr/texbin" exec-path)
(push "/usr/local/bin" exec-path)
;; ensure that C-<tab> works the same also in org-mode
(defun my-org-mode-hooks ()
(define-key org-mode-map [(control tab)] 'other-window))
(add-hook 'org-mode-hook 'my-org-mode-hooks)
(defun my-elisp-hooks ()
(define-key emacs-lisp-mode-map [(super return)] 'eval-last-sexp))
(add-hook 'emacs-lisp-mode-hook 'my-elisp-hooks)
;; Easily encrypt and decrypt files with GnuPG
(require 'epa-file)
;; ; (setq package-archives (cdr package-archives))
;; If we have opened multiple files with the same name, be a bit more
;; clever about how we display the name in the mode line.
(require 'uniquify)
;; Autocomplete all the things
(require 'company)
;; (add-to-list 'load-path "~/code/hsenv")
;; (require 'hsenv)
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
;; (add-to-list 'auto-mode-alist '("\\.ts$" . javascript-mode))
;; (add-to-list 'auto-mode-alist '("\\.less$" . css-mode))
(add-to-list 'auto-mode-alist '("\\.markdown$" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md$" . markdown-mode))
;; ---------------------------------------------------------------------
;; Haskell mode stuff
(defun insert-line-haskell ()
(interactive)
(beginning-of-line)
(insert "------------------------------------------------------------------------------\n"))
;; (add-to-list 'load-path "~/code/scionide/emacs/")
;; (require 'scion)
(defun my-todo ()
(interactive)
(comment-indent)
(insert "TODO: "))
(defun my-haskell-mode-hook ()
(define-key haskell-mode-map [(control ?c) ?-]
'insert-line-haskell)
(define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-left)
(define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right)
;; (scion-mode 1)
;; (scion-flycheck-on-save 1)
(setq fill-column 80)
;; (setq show-trailing-whitespace t)
;; (define-key haskell-mode-map (kbd "C-x C-d") nil)
;; (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
;; (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-file)
;; (define-key haskell-mode-map (kbd "C-c C-b") 'haskell-interactive-switch)
;; (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
;; (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
;; (define-key haskell-mode-map (kbd "C-c M-.") nil)
;; (define-key haskell-mode-map (kbd "C-c C-d") nil)
;; (define-key haskell-mode-map (kbd "C-c t") 'my-todo)
(turn-on-haskell-indent)
(yas-minor-mode 1)
;; (company-mode-on)
)
(add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
(defun three-columns ()
"Show the current buffer using three columns. Focus on the middle window."
(interactive)
(delete-other-windows)
(split-window-right)
(split-window-right)
(balance-windows)
(other-window 1)
(let ((h (window-height)))
(recenter-top-bottom (/ (* 3 h) 8))))
(global-set-key [f7] 'three-columns)
;; (add-to-list 'load-path "~/code/emacs/jshint-mode")
;; (require 'flymake-jshint)
;; (add-hook 'javascript-mode-hook
;; (lambda () (flymake-mode t)))
;; (setq scion-completing-read-function 'ido-completing-read)
;; (setq pp-escape-newlines nil)
;; (add-hook 'hs-minor-mode-hook
;; (lambda ()
;; (define-key hs-minor-mode-map [(super ?§)] 'hs-toggle-hiding)))
;; (add-to-list 'load-path "/usr/local/Cellar/coq/8.4pl3/lib/emacs/site-lisp")
;; (setq auto-mode-alist (cons '("\.v$" . coq-mode) auto-mode-alist))
;; (autoload 'coq-mode "coq" "Major mode for editing Coq vernacular." t)
;; (setq auto-mode-alist (cons '("\.nginx$" . conf-mode) auto-mode-alist))
;; (defun my-c-mode-hook ()
;; (yas-minor-mode))
;; (add-hook 'c-mode-common-hook 'my-c-mode-hook)
;; (defun insert-line-other ()
;; (interactive)
;; (beginning-of-line)
;; (let* ((start-len (length comment-start))
;; (end-len (length comment-end))
;; (line-len (- 78 start-len end-len)))
;; (insert comment-start)
;; (insert (make-string line-len ?-))
;; (insert comment-end))
;; (insert "\n"))
;; (defun my-c++-mode-hook ()
;; (define-key c++-mode-map [(control ?c) ?-]
;; 'insert-line-other))
;; (add-hook 'c++-mode-hook 'my-c++-mode-hook)
;; ; (global-hl-line-mode t)
;; ; (add-to-list 'load-path "/Users/nominolo/.emacs.d/elpa/sr-speedbar-0.1.8")
(server-start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment