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 '(flycheck-haskell-runghc-command
36 ("stack" "--verbosity" "silent" "runghc" "--no-ghc-package-path" "--")))
37 '(haskell-process-auto-import-loaded-modules t)
38 '(haskell-process-log t)
39 '(haskell-process-suggest-remove-import-lines t)
40 '(haskell-process-type (quote cabal-repl))
41 '(initial-frame-alist (quote ((fullscreen . maximized))))
42 '(send-mail-function (quote smtpmail-send-it)))
44 ;; Who use the bar to scroll?
45 (when (display-graphic-p)
53 ;; (load-theme 'tangotango t)
54 ;; (load-theme 'railscasts t)
55 ;; (load-theme 'leuven t)
60 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
63 (setq erc-autojoin-channels-alist
64 '((".*\\.freenode.net" "#tahoe-lafs")
65 (".*\\.oftc.net" "#debian-uk")
66 ;; (".*\\.mozilla.org" "#rust-beginners")
71 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
72 "324" "329" "332" "333" "353" "477"))
73 ;; don't show any of this
74 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
79 (when (y-or-n-p "Do you want to start IRC? ")
80 ;; (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
81 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
82 (erc-tls :server "irc.debian.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
84 ;; switch to ERC with Ctrl+c e
85 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
88 (setq ido-enable-flex-matching t)
89 (setq ido-everywhere t)
92 ;; disable tabs for indentation
93 (setq-default indent-tabs-mode nil)
95 ;; (require 'whitespace)
96 ;; (setq whitespace-style '(face lines-tail))
97 ;; (setq whitespace-line-column 80)
98 ;; (global-whitespace-mode t)
100 ;; ;; show trailing whitespaces
101 ;; (setq-default show-trailing-whitespace t)
102 ;; (setq-default indicate-empty-lines t)
105 (setq c-default-style "k&r"
109 (add-hook 'haskell-mode-hook #'hindent-mode)
110 (add-hook 'haskell-mode-hook 'flyspell-prog-mode)
112 (eval-after-load 'haskell-mode
113 '(define-key haskell-mode-map [f8] 'haskell-navigate-imports))
118 (let ((my-cabal-path (expand-file-name "~/.cabal/bin")))
119 (setenv "PATH" (concat my-cabal-path ":" (getenv "PATH")))
120 (add-to-list 'exec-path my-cabal-path))
122 (autoload 'ghc-init "ghc" nil t)
123 (autoload 'ghc-debug "ghc" nil t)
124 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
127 (eval-after-load 'flycheck
128 '(add-hook 'flycheck-mode-hook #'flycheck-haskell-setup))
131 (add-to-list 'load-path "~/.emacs.d/hs-lint")
133 (defun my-haskell-mode-hook ()
134 (local-set-key "\C-cl" 'hs-lint))
136 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
139 (add-hook 'before-save-hook #'gofmt-before-save)
140 (add-hook 'go-mode-hook (lambda ()
141 (local-set-key (kbd "C-c C-r")
142 'go-remove-unused-imports)))
143 (add-hook 'go-mode-hook (lambda ()
144 (local-set-key (kbd "C-c i")
148 (add-to-list 'load-path "~/.emacs.d/asp-mode")
149 (autoload 'asp-mode "asp-mode")
150 (setq auto-mode-alist
151 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
154 (global-linum-mode t)
155 (global-hl-line-mode 0)
157 ;; fci -- fill-column-indicator
158 (setq fci-rule-column 81)
159 (setq fci-rule-width 1)
160 (setq fci-rule-color "darkblue")
162 ;; turn off electric-indent-mode
163 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
166 (setq mail-user-agent 'message-user-agent)
167 (setq user-mail-address "ram@rkrishnan.org"
168 user-full-name "Ramakrishnan Muthukrishnan")
171 (setq smtpmail-stream-type 'ssl
172 smtpmail-smtp-server "mail.messagingengine.com"
173 smtpmail-smtp-service 465)
176 (require 'notmuch-address)
177 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
178 ;;(notmuch-address-message-insinuate)
181 (setq message-send-mail-function 'smtpmail-send-it)
185 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
188 ;; custom-set-faces was added by Custom.
189 ;; If you edit it by hand, you could mess it up, so be careful.
190 ;; Your init file should contain only one such instance.
191 ;; If there is more than one, they won't work right.
194 ;; company mode for auto completion
195 (add-hook 'after-init-hook 'global-company-mode)
197 ;; Reduce the time after which the company auto completion popup opens
198 (setq company-idle-delay 0.2)
200 ;; Reduce the number of characters before company kicks in
201 (setq company-minimum-prefix-length 1)
203 ;; Set path to racer binary
204 (setq racer-cmd "/home/ram/.cargo/bin/racer")
206 (add-hook 'rust-mode-hook
209 (racer-turn-on-eldoc)
210 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
211 (set (make-local-variable 'company-backends) '(company-racer))
212 (local-set-key (kbd "M-.") #'racer-find-definition)
213 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
216 ;; (add-hook 'prog-mode-hook 'highlight-todos)
219 (setq ledger-binary-path "~/.cabal/bin/hledger")
222 (setq exec-path (cons "/usr/local/go/bin" exec-path))
223 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
225 (defun go-mode-setup ()
227 (setq gofmt-command "goimports")
228 (add-hook 'before-save-hook 'gofmt-before-save))
230 (add-hook 'go-mode-hook 'go-mode-setup)
232 ;; alias man to w.o.man
233 (defalias 'man 'woman)
236 (defun eshell/emacs (&rest args)
237 "open a file in emacs"
240 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
242 ;(desktop-save-mode 1)
246 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
249 (add-hook 'after-init-hook #'global-flycheck-mode)