3 ;; y-or-n instead of yes-or-no
4 (defalias 'yes-or-no-p 'y-or-n-p)
6 ;; Don't use messages that you don't rea
7 (setq make-backup-files nil)
8 (setq initial-scratch-message "")
9 (setq inhibit-startup-message t)
12 (setq-default cursor-type '(bar . 2))
15 (column-number-mode 1)
18 ;; (set-default-font "Inconsolata-12")
20 ;; Don't let Emacs hurt your ears
23 ;; This is bound to f11 in Emacs 24.4
24 ;; (toggle-frame-fullscreen)
26 ;; custom-set-variables was added by Custom.
27 ;; If you edit it by hand, you could mess it up, so be careful.
28 ;; Your init file should contain only one such instance.
29 ;; If there is more than one, they won't work right.
30 '(initial-frame-alist (quote ((fullscreen . maximized))))
31 '(send-mail-function (quote smtpmail-send-it)))
33 ;; Who use the bar to scroll?
34 (when (display-graphic-p)
42 ;; (load-theme 'tangotango t)
43 ;; (load-theme 'railscasts t)
44 ;; (load-theme 'leuven t)
49 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
52 (setq erc-autojoin-channels-alist
53 '((".*\\.freenode.net" "#tahoe-lafs" "#haskell" "#haskell-beginners")
54 (".*\\.oftc.net" "#LeastAuthority")
55 ;;(".*\\.mozilla.org" "#rust-beginners")
60 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
61 "324" "329" "332" "333" "353" "477"))
62 ;; don't show any of this
63 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
68 (when (y-or-n-p "Do you want to start IRC? ")
69 ;;(erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
70 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
71 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
73 ;; switch to ERC with Ctrl+c e
74 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
77 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
78 (add-to-list 'exec-path "~/.cabal/bin")
79 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
82 (require 'haskell-process)
83 (require 'haskell-interactive-mode)
84 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
87 '(haskell-process-suggest-remove-import-lines t)
88 '(haskell-process-auto-import-loaded-modules t)
89 '(haskell-process-log t)
90 '(haskell-process-type 'stack-ghci))
92 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
93 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
94 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
95 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
96 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
97 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
98 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
99 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
102 (autoload 'ghc-init "ghc" nil t)
103 (autoload 'ghc-debug "ghc" nil t)
105 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
108 (setq ido-enable-flex-matching t)
109 (setq ido-everywhere t)
112 ;; disable tabs for indentation
113 (setq-default indent-tabs-mode nil)
115 ;; (require 'whitespace)
116 ;; (setq whitespace-style '(face lines-tail))
117 ;; (setq whitespace-line-column 80)
118 ;; (global-whitespace-mode t)
120 ;; ;; show trailing whitespaces
121 ;; (setq-default show-trailing-whitespace t)
122 ;; (setq-default indicate-empty-lines t)
125 (setq c-default-style "k&r"
129 (add-to-list 'load-path "~/.emacs.d/hs-lint")
131 (defun my-haskell-mode-hook ()
132 (local-set-key "\C-cl" 'hs-lint))
133 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
136 (add-hook 'before-save-hook #'gofmt-before-save)
137 (add-hook 'go-mode-hook (lambda ()
138 (local-set-key (kbd "C-c C-r")
139 'go-remove-unused-imports)))
140 (add-hook 'go-mode-hook (lambda ()
141 (local-set-key (kbd "C-c i")
145 (add-to-list 'load-path "~/.emacs.d/asp-mode")
146 (autoload 'asp-mode "asp-mode")
147 (setq auto-mode-alist
148 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
151 (global-linum-mode t)
152 (global-hl-line-mode 0)
154 ;; fci -- fill-column-indicator
155 (setq fci-rule-column 81)
156 (setq fci-rule-width 1)
157 (setq fci-rule-color "darkblue")
159 ;; turn off electric-indent-mode
160 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
163 (setq mail-user-agent 'message-user-agent)
164 (setq user-mail-address "ram@rkrishnan.org"
165 user-full-name "Ramakrishnan Muthukrishnan")
168 (setq smtpmail-stream-type 'ssl
169 smtpmail-smtp-server "mail.messagingengine.com"
170 smtpmail-smtp-service 465)
173 (require 'notmuch-address)
174 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
175 ;;(notmuch-address-message-insinuate)
178 (setq message-send-mail-function 'smtpmail-send-it)
182 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
185 ;; custom-set-faces was added by Custom.
186 ;; If you edit it by hand, you could mess it up, so be careful.
187 ;; Your init file should contain only one such instance.
188 ;; If there is more than one, they won't work right.
191 ;; company mode for auto completion
192 (add-hook 'after-init-hook 'global-company-mode)
195 ;; (add-hook 'prog-mode-hook 'highlight-todos)
198 (setq ledger-binary-path "~/.cabal/bin/hledger")
201 (setq exec-path (cons "/usr/local/go/bin" exec-path))
202 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
204 (defun go-mode-setup ()
206 (setq gofmt-command "goimports")
207 (add-hook 'before-save-hook 'gofmt-before-save))
209 (add-hook 'go-mode-hook 'go-mode-setup)
211 ;; alias man to w.o.man
212 (defalias 'man 'woman)
215 (defun eshell/emacs (&rest args)
216 "open a file in emacs"
219 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
221 ;(desktop-save-mode 1)