Created
November 24, 2012 06:13
-
-
Save kzfm/4138631 to your computer and use it in GitHub Desktop.
sample_init.el
This file contains 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
;;; packages.el | |
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) | |
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
; 言語を日本語にする | |
(set-language-environment 'Japanese) | |
; 極力UTF-8とする | |
(prefer-coding-system 'utf-8) | |
;; env | |
;(setq exec-path (cons "/Users/kzfm/.nvm/v0.8.10/bin:/usr/local/bin" exec-path)) | |
(setenv "PATH" | |
(concat "/Users/kzfm/.nvm/v0.8.10/bin:/usr/local/share/python:/Users/kzfm/bin:/usr/local/bin:/Users/kzfm/Library/Haskell/bin:" (getenv "PATH"))) | |
(dolist (path (reverse (split-string (getenv "PATH") ":"))) | |
(add-to-list 'exec-path path t)) | |
;; font | |
(when (>= emacs-major-version 23) | |
(set-face-attribute 'default nil | |
:family "monaco" | |
:height 140) | |
(set-fontset-font | |
(frame-parameter nil 'font) | |
'japanese-jisx0208 | |
'("Hiragino Maru Gothic Pro" . "iso10646-1")) | |
(set-fontset-font | |
(frame-parameter nil 'font) | |
'japanese-jisx0212 | |
'("Hiragino Maru Gothic Pro" . "iso10646-1")) | |
(set-fontset-font | |
(frame-parameter nil 'font) | |
'mule-unicode-0100-24ff | |
'("monaco" . "iso10646-1")) | |
(setq face-font-rescale-alist | |
'(("^-apple-hiragino.*" . 1.2) | |
(".*osaka-bold.*" . 1.2) | |
(".*osaka-medium.*" . 1.2) | |
(".*courier-bold-.*-mac-roman" . 1.0) | |
(".*monaco cy-bold-.*-mac-cyrillic" . 0.9) | |
(".*monaco-bold-.*-mac-roman" . 0.9) | |
("-cdac$" . 1.3)))) | |
;; http://d.hatena.ne.jp/TakashiHattori/20120629/1340942555 | |
(add-hook 'emacs-startup-hook | |
(function (lambda () | |
(require 'auto-complete-config) | |
(ac-config-default)))) | |
;; custom-theme | |
(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. | |
'(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"]) | |
'(custom-enabled-themes (quote (manoj-dark))) | |
'(safe-local-variable-values (quote ((encoding . utf-8))))) | |
(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. | |
) | |
;; ignore active-process | |
(defadvice save-buffers-kill-emacs (around no-query-kill-emacs activate) | |
"Prevent annoying \"Active processes exist\" query when you quit Emacs." | |
(flet ((process-list ())) ad-do-it)) | |
(autoload 'ghc-init "ghc" nil t) | |
(add-hook 'haskell-mode-hook '(lambda () | |
(ghc-init) | |
(local-set-key "\C-j" (lambda () (interactive)(insert " -> "))) | |
(local-set-key "\M-j" (lambda () (interactive)(insert " => "))) | |
(local-set-key "\C-l" (lambda ()(interactive)(insert " <- "))) | |
)) | |
(defadvice inferior-haskell-load-file (after change-focus-after-load) | |
"Change focus to GHCi window after C-c C-l command" | |
(other-window 1)) | |
(ad-activate 'inferior-haskell-load-file) | |
;; auto-complete | |
(require 'auto-complete) | |
(global-auto-complete-mode t) | |
(define-key ac-complete-mode-map "\C-n" 'ac-next) | |
(define-key ac-complete-mode-map "\C-p" 'ac-previous) | |
;; http://d.hatena.ne.jp/TakashiHattori/20120629/1340942555 | |
(add-hook 'emacs-startup-hook | |
(function (lambda () | |
(require 'auto-complete-config) | |
(ac-config-default)))) | |
;; haskell ghc-mod | |
;; https://github.com/kazu-yamamoto/ghc-mod | |
(autoload 'ghc-init "ghc" nil t) | |
(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment