2 ;; y-or-n instead of yes-or-no
3 (defalias 'yes-or-no-p 'y-or-n-p)
5 ;; Don't use messages that you don't rea
6 (setq make-backup-files nil)
7 (setq initial-scratch-message "")
8 (setq inhibit-startup-message t)
11 (setq-default cursor-type '(bar . 2))
14 (column-number-mode 1)
17 ;; (set-default-font "Inconsolata-12")
19 ;; Don't let Emacs hurt your ears
22 ;; This is bound to f11 in Emacs 24.4
23 ;; (toggle-frame-fullscreen)
25 ;; custom-set-variables was added by Custom.
26 ;; If you edit it by hand, you could mess it up, so be careful.
27 ;; Your init file should contain only one such instance.
28 ;; If there is more than one, they won't work right.
29 '(haskell-process-auto-import-loaded-modules t)
30 '(haskell-process-log t)
31 '(haskell-process-suggest-remove-import-lines t)
32 '(haskell-process-type (quote cabal-repl))
33 '(initial-frame-alist (quote ((fullscreen . maximized))))
34 '(send-mail-function (quote smtpmail-send-it)))
35 ;; Who use the bar to scroll?
36 (when (display-graphic-p)
45 (add-to-list 'package-archives
46 '("melpa" . "http://melpa.milkbox.net/packages/") t)
47 (add-to-list 'package-archives
48 '("marmalade" . "http://marmalade-repo.org/packages/") t)
51 ; fetch the list of packages available
52 (unless package-archive-contents
53 (package-refresh-contents))
55 ;; make sure my list of packages are installed
56 (setq package-list '(go-mode
72 ; install the missing packages
73 (dolist (package package-list)
74 (unless (package-installed-p package)
75 (package-install package)))
78 ;; (load-theme 'tangotango t)
79 ;; (load-theme 'railscasts t)
80 ;; (load-theme 'leuven t)
85 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
88 (setq erc-autojoin-channels-alist
89 '((".*\\.freenode.net" "#tahoe-lafs" "#plan9chan" "#cat-v")
90 (".*\\.oftc.net" "#LeastAuthority")))
94 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
96 "324" "329" "332" "333" "353" "477"))
97 ;; don't show any of this
98 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
103 (when (y-or-n-p "Do you want to start IRC? ")
104 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
105 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
107 ;; switch to ERC with Ctrl+c e
108 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
111 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
112 (add-to-list 'exec-path "~/.cabal/bin")
113 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
114 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
115 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
116 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
117 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
120 (require 'haskell-interactive-mode)
121 (require 'haskell-process)
122 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
126 (eval-after-load "haskell-mode"
128 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
129 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
130 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
131 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
132 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
133 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
134 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
135 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
137 (define-key haskell-cabal-mode-map (kbd "C-`") 'haskell-interactive-bring)
138 (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
139 (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
140 (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))
143 (autoload 'ghc-init "ghc" nil t)
144 (autoload 'ghc-debug "ghc" nil t)
146 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
150 (setq ido-enable-flex-matching t)
151 (setq ido-everywhere t)
154 ;; disable tabs for indentation
155 (setq-default indent-tabs-mode nil)
157 ;; (require 'whitespace)
158 ;; (setq whitespace-style '(face lines-tail))
159 ;; (setq whitespace-line-column 80)
160 ;; (global-whitespace-mode t)
162 ;; ;; show trailing whitespaces
163 ;; (setq-default show-trailing-whitespace t)
164 ;; (setq-default indicate-empty-lines t)
167 (setq c-default-style "k&r"
171 (add-to-list 'load-path "~/.emacs.d/hs-lint")
173 (defun my-haskell-mode-hook ()
174 (local-set-key "\C-cl" 'hs-lint))
175 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
178 (add-hook 'before-save-hook #'gofmt-before-save)
179 (add-hook 'go-mode-hook (lambda ()
180 (local-set-key (kbd "C-c C-r")
181 'go-remove-unused-imports)))
182 (add-hook 'go-mode-hook (lambda ()
183 (local-set-key (kbd "C-c i")
187 (add-to-list 'load-path "~/.emacs.d/asp-mode")
188 (autoload 'asp-mode "asp-mode")
189 (setq auto-mode-alist
190 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
193 (global-linum-mode t)
194 (global-hl-line-mode 0)
196 ;; fci -- fill-column-indicator
197 (setq fci-rule-column 81)
198 (setq fci-rule-width 1)
199 (setq fci-rule-color "darkblue")
201 ;; turn off electric-indent-mode
202 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
205 (setq mail-user-agent 'message-user-agent)
206 (setq user-mail-address "ram@rkrishnan.org"
207 user-full-name "Ramakrishnan Muthukrishnan")
210 (setq smtpmail-stream-type 'ssl
211 smtpmail-smtp-server "mail.messagingengine.com"
212 smtpmail-smtp-service 465)
215 (require 'notmuch-address)
216 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
217 (notmuch-address-message-insinuate)
220 (setq message-send-mail-function 'smtpmail-send-it)
224 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
227 ;; custom-set-faces was added by Custom.
228 ;; If you edit it by hand, you could mess it up, so be careful.
229 ;; Your init file should contain only one such instance.
230 ;; If there is more than one, they won't work right.
235 (ac-linum-workaround)