; Add MELPA repository (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) ; Make Emacs look in Cabal directory for binaries (let ((my-cabal-path (expand-file-name "~/.cabal/bin"))) (setenv "PATH" (concat my-cabal-path ":" (getenv "PATH"))) (add-to-list 'exec-path my-cabal-path)) ; HASKELL-MODE ; ------------ ; Choose indentation mode ;; Use haskell-mode indentation (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) ;; Use hi2 ;(require 'hi2) ;(add-hook 'haskell-mode-hook 'turn-on-hi2) ;; Use structured-haskell-mode ;(add-hook 'haskell-mode-hook 'structured-haskell-mode) ; Add F8 key combination for going to imports block (eval-after-load 'haskell-mode '(define-key haskell-mode-map [f8] 'haskell-navigate-imports)) (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 ["#eee8d5" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#839496"]) '(company-ghc-show-info t) '(compilation-message-face (quote default)) '(cua-global-mark-cursor-color "#2aa198") '(cua-normal-cursor-color "#657b83") '(cua-overwrite-cursor-color "#b58900") '(cua-read-only-cursor-color "#859900") '(custom-safe-themes (quote ("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "0c29db826418061b40564e3351194a3d4a125d182c6ee5178c237a7364f0ff12" "ff9e6deb9cfc908381c1267f407b8830bcad6028231a5f736246b9fc65e92b44" default))) '(fci-rule-color "#eee8d5") '(global-linum-mode t) '(haskell-indent-spaces 4) '(haskell-process-auto-import-loaded-modules t) '(haskell-process-log t) '(haskell-process-suggest-remove-import-lines t) '(haskell-process-type (quote cabal-repl)) '(haskell-tags-on-save t) '(highlight-changes-colors (quote ("#d33682" "#6c71c4"))) '(highlight-symbol-colors (--map (solarized-color-blend it "#fdf6e3" 0.25) (quote ("#b58900" "#2aa198" "#dc322f" "#6c71c4" "#859900" "#cb4b16" "#268bd2")))) '(highlight-symbol-foreground-color "#586e75") '(highlight-tail-colors (quote (("#eee8d5" . 0) ("#B4C342" . 20) ("#69CABF" . 30) ("#69B7F0" . 50) ("#DEB542" . 60) ("#F2804F" . 70) ("#F771AC" . 85) ("#eee8d5" . 100)))) '(hl-bg-colors (quote ("#DEB542" "#F2804F" "#FF6E64" "#F771AC" "#9EA0E5" "#69B7F0" "#69CABF" "#B4C342"))) '(hl-fg-colors (quote ("#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3"))) '(line-number-mode t) '(linum-format " %7i ") '(magit-use-overlays nil) '(menu-bar-mode nil) '(pos-tip-background-color "#eee8d5") '(pos-tip-foreground-color "#586e75") '(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#eee8d5" 0.2)) '(term-default-bg-color "#fdf6e3") '(term-default-fg-color "#657b83") '(tool-bar-mode nil) '(vc-annotate-background nil) '(vc-annotate-color-map (quote ((20 . "#dc322f") (40 . "#c85d17") (60 . "#be730b") (80 . "#b58900") (100 . "#a58e00") (120 . "#9d9100") (140 . "#959300") (160 . "#8d9600") (180 . "#859900") (200 . "#669b32") (220 . "#579d4c") (240 . "#489e65") (260 . "#399f7e") (280 . "#2aa198") (300 . "#2898af") (320 . "#2793ba") (340 . "#268fc6") (360 . "#268bd2")))) '(vc-annotate-very-old-color nil) '(weechat-color-list (quote (unspecified "#fdf6e3" "#eee8d5" "#990A1B" "#dc322f" "#546E00" "#859900" "#7B6000" "#b58900" "#00629D" "#268bd2" "#93115C" "#d33682" "#00736F" "#2aa198" "#657b83" "#839496")))) ; Add key combinations for interactive haskell-mode (eval-after-load 'haskell-mode '(progn (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload) (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch) (define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type) (define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info) (define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build) (define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal) (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space))) (eval-after-load 'haskell-cabal '(progn (define-key haskell-cabal-mode-map (kbd "C-c C-z") 'haskell-interactive-switch) (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear) (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build) (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal))) (eval-after-load 'haskell-mode '(define-key haskell-mode-map (kbd "C-c C-o") 'haskell-compile)) (eval-after-load 'haskell-cabal '(define-key haskell-cabal-mode-map (kbd "C-c C-o") 'haskell-compile)) ; GHC-MOD ; ------- (autoload 'ghc-init "ghc" nil t) (autoload 'ghc-debug "ghc" nil t) (add-hook 'haskell-mode-hook (lambda () (ghc-init))) ; COMPANY-GHC ; ----------- ; Enable company-mode (require 'company) ; Use company in Haskell buffers ; (add-hook 'haskell-mode-hook 'company-mode) ; Use company in all buffers (add-hook 'after-init-hook 'global-company-mode) (add-to-list 'company-backends 'company-ghc) ; Enable hindent (add-hook 'haskell-mode-hook #'hindent-mode) (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. ) ;; Load color scheme (load-theme 'spolsky) ;; IDO, ido-vertical flx-ido-mode and Smex configuration (require 'flx-ido) (ido-mode 1) (ido-vertical-mode 1) (ido-everywhere 1) (flx-ido-mode 1) ;; disable ido faces to see flx highlights. (setq ido-enable-flex-matching t) (setq ido-use-faces nil) ;; Smex (require 'smex) ; Not needed if you use package.el (smex-initialize) ; Can be omitted. This might cause a (minimal) delay ; when Smex is auto-initialized on its first run. ;; Bind M-x to smex instead of regular execute command (global-set-key (kbd "M-x") 'smex) (global-set-key (kbd "M-X") 'smex-major-mode-commands) ;; This is your old M-x. (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) ;; ido-ubiquitos ;;(setq org-completion-use-ido t) ;; ido completion in org mode enable later (setq magit-completing-read-function 'magit-ido-completing-read) (require 'ido-ubiquitous) (ido-ubiquitous-mode 1) ;; projectile (projectile-global-mode) ;;markdown-mode (autoload 'markdown-mode "markdown-mode" "Major mode for editing Markdown files" t) (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) ;;Set key for magit-status (global-set-key (kbd "C-x m") 'magit-status) ;;Set up hooks so that .jptxt and .jpmd files are treated as japanese with japanese input and large font size. (defun my-set-text-japanese () (when (and (stringp buffer-file-name) (or (string-match "\\.jp.txt\\'" buffer-file-name) (string-match "\\.jp.md\\'" buffer-file-name))) (set-input-method "japanese") (text-scale-set 10))) (add-hook 'find-file-hook 'my-set-text-japanese)