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 '(initial-frame-alist (quote ((fullscreen . maximized))))
30 '(send-mail-function (quote smtpmail-send-it)))
31 ;; Who use the bar to scroll?
32 (when (display-graphic-p)
41 (add-to-list 'package-archives
42 '("melpa" . "http://melpa.milkbox.net/packages/") t)
43 (add-to-list 'package-archives
44 '("marmalade" . "http://marmalade-repo.org/packages/") t)
47 ; fetch the list of packages available
48 (unless package-archive-contents
49 (package-refresh-contents))
51 ;; make sure my list of packages are installed
52 (setq package-list '(go-mode
68 ; install the missing packages
69 (dolist (package package-list)
70 (unless (package-installed-p package)
71 (package-install package)))
74 ;; (load-theme 'tangotango t)
75 ;; (load-theme 'railscasts t)
76 ;; (load-theme 'leuven t)
81 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
84 (setq erc-autojoin-channels-alist
85 '((".*\\.freenode.net" "#tahoe-lafs")
86 (".*\\.oftc.net" "#LeastAuthority")
87 ;;(".*\\.mozilla.org" "#rust-beginners")
92 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
93 "324" "329" "332" "333" "353" "477"))
94 ;; don't show any of this
95 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
100 (when (y-or-n-p "Do you want to start IRC? ")
101 ;;(erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
102 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
103 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
105 ;; switch to ERC with Ctrl+c e
106 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
109 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
110 (add-to-list 'exec-path "~/.cabal/bin")
111 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
114 (require 'haskell-interactive-mode)
115 (require 'haskell-process)
116 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
118 (custom-set-variables
119 '(haskell-process-suggest-remove-import-lines t)
120 '(haskell-process-auto-import-loaded-modules t)
121 '(haskell-process-log t)
122 '(haskell-process-type 'stack-ghci))
124 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
125 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
126 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
127 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
128 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
129 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
130 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
131 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
134 (autoload 'ghc-init "ghc" nil t)
135 (autoload 'ghc-debug "ghc" nil t)
137 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
140 (setq ido-enable-flex-matching t)
141 (setq ido-everywhere t)
144 ;; disable tabs for indentation
145 (setq-default indent-tabs-mode nil)
147 ;; (require 'whitespace)
148 ;; (setq whitespace-style '(face lines-tail))
149 ;; (setq whitespace-line-column 80)
150 ;; (global-whitespace-mode t)
152 ;; ;; show trailing whitespaces
153 ;; (setq-default show-trailing-whitespace t)
154 ;; (setq-default indicate-empty-lines t)
157 (setq c-default-style "k&r"
161 (add-to-list 'load-path "~/.emacs.d/hs-lint")
163 (defun my-haskell-mode-hook ()
164 (local-set-key "\C-cl" 'hs-lint))
165 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
168 (add-hook 'before-save-hook #'gofmt-before-save)
169 (add-hook 'go-mode-hook (lambda ()
170 (local-set-key (kbd "C-c C-r")
171 'go-remove-unused-imports)))
172 (add-hook 'go-mode-hook (lambda ()
173 (local-set-key (kbd "C-c i")
177 (add-to-list 'load-path "~/.emacs.d/asp-mode")
178 (autoload 'asp-mode "asp-mode")
179 (setq auto-mode-alist
180 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
183 (global-linum-mode t)
184 (global-hl-line-mode 0)
186 ;; fci -- fill-column-indicator
187 (setq fci-rule-column 81)
188 (setq fci-rule-width 1)
189 (setq fci-rule-color "darkblue")
191 ;; turn off electric-indent-mode
192 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
195 (setq mail-user-agent 'message-user-agent)
196 (setq user-mail-address "ram@rkrishnan.org"
197 user-full-name "Ramakrishnan Muthukrishnan")
200 (setq smtpmail-stream-type 'ssl
201 smtpmail-smtp-server "mail.messagingengine.com"
202 smtpmail-smtp-service 465)
205 (require 'notmuch-address)
206 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
207 (notmuch-address-message-insinuate)
210 (setq message-send-mail-function 'smtpmail-send-it)
214 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
217 ;; custom-set-faces was added by Custom.
218 ;; If you edit it by hand, you could mess it up, so be careful.
219 ;; Your init file should contain only one such instance.
220 ;; If there is more than one, they won't work right.
225 (ac-linum-workaround)
228 ;; (add-hook 'prog-mode-hook 'highlight-todos)
231 (setq ledger-binary-path "~/.cabal/bin/hledger")
234 (setq exec-path (cons "/usr/local/go/bin" exec-path))
235 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
237 (defun go-mode-setup ()
239 (setq gofmt-command "goimports")
240 (add-hook 'before-save-hook 'gofmt-before-save))
242 (add-hook 'go-mode-hook 'go-mode-setup)
244 ;; alias man to w.o.man
245 (defalias 'man 'woman)
248 (defun eshell/emacs (&rest args)
249 "open a file in emacs"
252 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
254 ;(desktop-save-mode 1)