3 ;; y-or-n instead of yes-or-no
4 (defalias 'yes-or-no-p 'y-or-n-p)
6 ;; Don't show startup msg, don't store tilde files
7 (setq make-backup-files nil)
8 (setq initial-scratch-message "")
9 (setq inhibit-startup-message t)
11 ;; turn OFF syntax highlighting
12 (global-font-lock-mode 0)
15 (setq-default cursor-type '(bar . 2))
18 (column-number-mode 1)
21 ;; (set-default-font "Inconsolata-12")
23 ;; Don't let Emacs hurt your ears
26 ;; This is bound to f11 in Emacs 24.4
27 ;; (toggle-frame-fullscreen)
29 ;; custom-set-variables was added by Custom.
30 ;; If you edit it by hand, you could mess it up, so be careful.
31 ;; Your init file should contain only one such instance.
32 ;; If there is more than one, they won't work right.
33 '(initial-frame-alist (quote ((fullscreen . maximized))))
34 '(send-mail-function (quote smtpmail-send-it)))
36 ;; Who use the bar to scroll?
37 (when (display-graphic-p)
45 ;; (load-theme 'tangotango t)
46 ;; (load-theme 'railscasts t)
47 ;; (load-theme 'leuven t)
52 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
55 (setq erc-autojoin-channels-alist
56 '((".*\\.freenode.net" "#tahoe-lafs") ;; #inferno "#plan9chan" "#cat-v")
57 (".*\\.oftc.net" "#LeastAuthority")))
61 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
62 "324" "329" "332" "333" "353" "477"))
63 ;; don't show any of this
64 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
69 (when (y-or-n-p "Do you want to start IRC? ")
70 ;;(erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
71 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
72 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
74 ;; switch to ERC with Ctrl+c e
75 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
78 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
79 (add-to-list 'exec-path "~/.cabal/bin")
80 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
83 (require 'haskell-process)
84 (require 'haskell-interactive-mode)
85 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
88 '(haskell-process-suggest-remove-import-lines t)
89 '(haskell-process-auto-import-loaded-modules t)
90 '(haskell-process-log t)
91 '(haskell-process-type 'stack-ghci))
93 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
94 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
95 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
96 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
97 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
98 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
99 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
100 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
103 (autoload 'ghc-init "ghc" nil t)
104 (autoload 'ghc-debug "ghc" nil t)
106 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
109 (setq ido-enable-flex-matching t)
110 (setq ido-everywhere t)
113 ;; disable tabs for indentation
114 (setq-default indent-tabs-mode nil)
116 ;; (require 'whitespace)
117 ;; (setq whitespace-style '(face lines-tail))
118 ;; (setq whitespace-line-column 80)
119 ;; (global-whitespace-mode t)
121 ;; ;; show trailing whitespaces
122 ;; (setq-default show-trailing-whitespace t)
123 ;; (setq-default indicate-empty-lines t)
126 (setq c-default-style "k&r"
130 (add-to-list 'load-path "~/.emacs.d/hs-lint")
132 (defun my-haskell-mode-hook ()
133 (local-set-key "\C-cl" 'hs-lint))
134 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
137 (add-hook 'before-save-hook #'gofmt-before-save)
138 (add-hook 'go-mode-hook (lambda ()
139 (local-set-key (kbd "C-c C-r")
140 'go-remove-unused-imports)))
141 (add-hook 'go-mode-hook (lambda ()
142 (local-set-key (kbd "C-c i")
146 (add-to-list 'load-path "~/.emacs.d/asp-mode")
147 (autoload 'asp-mode "asp-mode")
148 (setq auto-mode-alist
149 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
152 (global-linum-mode t)
153 (global-hl-line-mode 0)
155 ;; fci -- fill-column-indicator
156 (setq fci-rule-column 81)
157 (setq fci-rule-width 1)
158 (setq fci-rule-color "darkblue")
160 ;; turn off electric-indent-mode
161 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
164 (setq mail-user-agent 'message-user-agent)
165 (setq user-mail-address "ram@rkrishnan.org"
166 user-full-name "Ramakrishnan Muthukrishnan")
169 (setq smtpmail-stream-type 'ssl
170 smtpmail-smtp-server "mail.messagingengine.com"
171 smtpmail-smtp-service 465)
174 (require 'notmuch-address)
175 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
176 ;;(notmuch-address-message-insinuate)
179 (setq message-send-mail-function 'smtpmail-send-it)
183 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
186 ;; custom-set-faces was added by Custom.
187 ;; If you edit it by hand, you could mess it up, so be careful.
188 ;; Your init file should contain only one such instance.
189 ;; If there is more than one, they won't work right.
192 ;; company mode for auto completion
193 (add-hook 'after-init-hook 'global-company-mode)
196 ;; (add-hook 'prog-mode-hook 'highlight-todos)
199 (setq ledger-binary-path "~/.cabal/bin/hledger")
202 (setq exec-path (cons "/usr/local/go/bin" exec-path))
203 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
205 (defun go-mode-setup ()
207 (setq gofmt-command "goimports")
208 (add-hook 'before-save-hook 'gofmt-before-save))
210 (add-hook 'go-mode-hook 'go-mode-setup)
212 ;; alias man to w.o.man
213 (defalias 'man 'woman)
216 (defun eshell/emacs (&rest args)
217 "open a file in emacs"
220 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
222 ;(desktop-save-mode 1)
226 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
229 (add-hook 'after-init-hook #'global-flycheck-mode)