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")
22 (set-default-font "InconsolataGo-12")
24 ;; Don't let Emacs hurt your ears
27 ;; This is bound to f11 in Emacs 24.4
28 ;; (toggle-frame-fullscreen)
30 ;; custom-set-variables was added by Custom.
31 ;; If you edit it by hand, you could mess it up, so be careful.
32 ;; Your init file should contain only one such instance.
33 ;; If there is more than one, they won't work right.
34 '(initial-frame-alist (quote ((fullscreen . maximized))))
35 '(send-mail-function (quote smtpmail-send-it)))
37 ;; Who use the bar to scroll?
38 (when (display-graphic-p)
46 ;; (load-theme 'tangotango t)
47 ;; (load-theme 'railscasts t)
48 ;; (load-theme 'leuven t)
53 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
56 (setq erc-autojoin-channels-alist
57 '((".*\\.freenode.net" "#tahoe-lafs")
58 (".*\\.oftc.net" "#LeastAuthority")
59 (".*\\.mozilla.org" "#rust-beginners")
64 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
65 "324" "329" "332" "333" "353" "477"))
66 ;; don't show any of this
67 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
72 (when (y-or-n-p "Do you want to start IRC? ")
73 (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
74 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
75 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
77 ;; switch to ERC with Ctrl+c e
78 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
81 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
82 (add-to-list 'exec-path "~/.cabal/bin")
83 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
86 (require 'haskell-process)
87 (require 'haskell-interactive-mode)
88 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
91 '(haskell-process-suggest-remove-import-lines t)
92 '(haskell-process-auto-import-loaded-modules t)
93 '(haskell-process-log t)
94 '(haskell-process-type 'stack-ghci))
96 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
97 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
98 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
99 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
100 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
101 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
102 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
103 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)
106 (autoload 'ghc-init "ghc" nil t)
107 (autoload 'ghc-debug "ghc" nil t)
109 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
112 (setq ido-enable-flex-matching t)
113 (setq ido-everywhere t)
116 ;; disable tabs for indentation
117 (setq-default indent-tabs-mode nil)
119 ;; (require 'whitespace)
120 ;; (setq whitespace-style '(face lines-tail))
121 ;; (setq whitespace-line-column 80)
122 ;; (global-whitespace-mode t)
124 ;; ;; show trailing whitespaces
125 ;; (setq-default show-trailing-whitespace t)
126 ;; (setq-default indicate-empty-lines t)
129 (setq c-default-style "k&r"
133 (add-to-list 'load-path "~/.emacs.d/hs-lint")
135 (defun my-haskell-mode-hook ()
136 (local-set-key "\C-cl" 'hs-lint))
138 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
141 (add-hook 'before-save-hook #'gofmt-before-save)
142 (add-hook 'go-mode-hook (lambda ()
143 (local-set-key (kbd "C-c C-r")
144 'go-remove-unused-imports)))
145 (add-hook 'go-mode-hook (lambda ()
146 (local-set-key (kbd "C-c i")
150 (add-to-list 'load-path "~/.emacs.d/asp-mode")
151 (autoload 'asp-mode "asp-mode")
152 (setq auto-mode-alist
153 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
156 (global-linum-mode t)
157 (global-hl-line-mode 0)
159 ;; fci -- fill-column-indicator
160 (setq fci-rule-column 81)
161 (setq fci-rule-width 1)
162 (setq fci-rule-color "darkblue")
164 ;; turn off electric-indent-mode
165 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
168 (setq mail-user-agent 'message-user-agent)
169 (setq user-mail-address "ram@rkrishnan.org"
170 user-full-name "Ramakrishnan Muthukrishnan")
173 (setq smtpmail-stream-type 'ssl
174 smtpmail-smtp-server "mail.messagingengine.com"
175 smtpmail-smtp-service 465)
178 (require 'notmuch-address)
179 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
180 ;;(notmuch-address-message-insinuate)
183 (setq message-send-mail-function 'smtpmail-send-it)
187 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
190 ;; custom-set-faces was added by Custom.
191 ;; If you edit it by hand, you could mess it up, so be careful.
192 ;; Your init file should contain only one such instance.
193 ;; If there is more than one, they won't work right.
196 ;; company mode for auto completion
197 (add-hook 'after-init-hook 'global-company-mode)
199 ;; Reduce the time after which the company auto completion popup opens
200 (setq company-idle-delay 0.2)
202 ;; Reduce the number of characters before company kicks in
203 (setq company-minimum-prefix-length 1)
205 ;; Set path to racer binary
206 (setq racer-cmd "/home/ram/.cargo/bin/racer")
208 (add-hook 'rust-mode-hook
211 (racer-turn-on-eldoc)
212 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
213 (set (make-local-variable 'company-backends) '(company-racer))
214 (local-set-key (kbd "M-.") #'racer-find-definition)
215 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
218 ;; (add-hook 'prog-mode-hook 'highlight-todos)
221 (setq ledger-binary-path "~/.cabal/bin/hledger")
224 (setq exec-path (cons "/usr/local/go/bin" exec-path))
225 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
227 (defun go-mode-setup ()
229 (setq gofmt-command "goimports")
230 (add-hook 'before-save-hook 'gofmt-before-save))
232 (add-hook 'go-mode-hook 'go-mode-setup)
234 ;; alias man to w.o.man
235 (defalias 'man 'woman)
238 (defun eshell/emacs (&rest args)
239 "open a file in emacs"
242 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
244 ;(desktop-save-mode 1)
248 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
251 (add-hook 'after-init-hook #'global-flycheck-mode)