]> git.rkrishnan.org Git - .emacs.d.git/blob - init.el
haskell mode configs
[.emacs.d.git] / init.el
1 ; Prevent the cursor from blinking
2 (blink-cursor-mode 0)
3 (show-paren-mode 1)
4 ;; y-or-n instead of yes-or-no
5 (defalias 'yes-or-no-p 'y-or-n-p)
6
7 ;; Don't use messages that you don't rea
8 (setq make-backup-files nil)
9 (setq initial-scratch-message "")
10 (setq inhibit-startup-message t)
11
12 ;; column number
13 (column-number-mode 1)
14
15 ;; Don't let Emacs hurt your ears
16 (setq visible-bell t)
17
18 ;; This is bound to f11 in Emacs 24.4
19 ;; (toggle-frame-fullscreen)
20 (custom-set-variables
21  '(initial-frame-alist (quote ((fullscreen . maximized)))))
22 ;; Who use the bar to scroll?
23 (when (display-graphic-p)
24   (progn
25     (scroll-bar-mode 0)
26
27     (tool-bar-mode 0)
28     (menu-bar-mode 0)))
29
30 ; my-packages.el
31 (require 'package)
32 (add-to-list 'package-archives
33              '("melpa" . "http://melpa.milkbox.net/packages/") t)
34 (add-to-list 'package-archives
35              '("marmalade" . "http://marmalade-repo.org/packages/") t)
36 (package-initialize)
37
38 ; fetch the list of packages available
39 (unless package-archive-contents
40   (package-refresh-contents))
41
42 ;; make sure my list of packages are installed
43 (setq package-list '(rust-mode haskell-mode monokai-theme ghc))
44
45 ; install the missing packages
46 (dolist (package package-list)
47   (unless (package-installed-p package)
48     (package-install package)))
49
50 ;; monokai
51 (load-theme 'monokai t)
52
53 ;; erc
54 (require 'erc)
55 (require 'tls)
56 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
57
58 (erc-autojoin-mode t)
59 (setq erc-autojoin-channels-alist
60   '((".*\\.freenode.net" "#tahoe-lafs" "#haskell-beginners")
61     (".*\\.oftc.net" "#LeastAuthority")))
62
63 ;; check channels
64 (erc-track-mode t)
65 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
66
67                                  "324" "329" "332" "333" "353" "477"))
68 ;; don't show any of this
69 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
70
71 (defun start-erc ()
72   "Connect to IRC."
73   (interactive)
74   (when (y-or-n-p "Do you want to start IRC? ")
75     (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
76     (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
77
78 ;; switch to ERC with Ctrl+c e
79 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
80
81 ;; haskell mode
82 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
83 (add-to-list 'exec-path "~/.cabal/bin")
84 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
85 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
86 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
87 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
88 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
89
90 ;; ghc-mod
91 (autoload 'ghc-init "ghc" nil t)
92 (autoload 'ghc-debug "ghc" nil t)
93 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
94
95 ;; ido
96 (setq ido-enable-flex-matching t)
97 (setq ido-everywhere t)
98 (ido-mode 1)
99
100 ;; disable tabs for indentation
101 (setq-default indent-tabs-mode nil)
102
103 ;; (require 'whitespace)
104 ;; (setq whitespace-style '(face lines-tail))
105 ;; (setq whitespace-line-column 80)
106 ;; (global-whitespace-mode t)
107
108 ;; ;; show trailing whitespaces
109 ;; (setq-default show-trailing-whitespace t)
110 ;; (setq-default indicate-empty-lines t)
111
112 ;; C style
113 (setq c-default-style "k&r"
114       c-basic-offset 4)
115