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
80 ;; Haskell intero mode
81 (add-hook 'haskell-mode-hook 'intero-mode)
84 (setq ido-enable-flex-matching t)
85 (setq ido-everywhere t)
88 ;; disable tabs for indentation
89 (setq-default indent-tabs-mode nil)
91 ;; (require 'whitespace)
92 ;; (setq whitespace-style '(face lines-tail))
93 ;; (setq whitespace-line-column 80)
94 ;; (global-whitespace-mode t)
96 ;; ;; show trailing whitespaces
97 ;; (setq-default show-trailing-whitespace t)
98 ;; (setq-default indicate-empty-lines t)
101 (setq c-default-style "k&r"
105 (add-to-list 'load-path "~/.emacs.d/hs-lint")
107 (defun my-haskell-mode-hook ()
108 (local-set-key "\C-cl" 'hs-lint))
110 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
113 (add-hook 'before-save-hook #'gofmt-before-save)
114 (add-hook 'go-mode-hook (lambda ()
115 (local-set-key (kbd "C-c C-r")
116 'go-remove-unused-imports)))
117 (add-hook 'go-mode-hook (lambda ()
118 (local-set-key (kbd "C-c i")
122 (add-to-list 'load-path "~/.emacs.d/asp-mode")
123 (autoload 'asp-mode "asp-mode")
124 (setq auto-mode-alist
125 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
128 (global-linum-mode t)
129 (global-hl-line-mode 0)
131 ;; fci -- fill-column-indicator
132 (setq fci-rule-column 81)
133 (setq fci-rule-width 1)
134 (setq fci-rule-color "darkblue")
136 ;; turn off electric-indent-mode
137 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
140 (setq mail-user-agent 'message-user-agent)
141 (setq user-mail-address "ram@rkrishnan.org"
142 user-full-name "Ramakrishnan Muthukrishnan")
145 (setq smtpmail-stream-type 'ssl
146 smtpmail-smtp-server "mail.messagingengine.com"
147 smtpmail-smtp-service 465)
150 (require 'notmuch-address)
151 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
152 ;;(notmuch-address-message-insinuate)
155 (setq message-send-mail-function 'smtpmail-send-it)
159 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
162 ;; custom-set-faces was added by Custom.
163 ;; If you edit it by hand, you could mess it up, so be careful.
164 ;; Your init file should contain only one such instance.
165 ;; If there is more than one, they won't work right.
168 ;; company mode for auto completion
169 (add-hook 'after-init-hook 'global-company-mode)
171 ;; Reduce the time after which the company auto completion popup opens
172 (setq company-idle-delay 0.2)
174 ;; Reduce the number of characters before company kicks in
175 (setq company-minimum-prefix-length 1)
177 ;; Set path to racer binary
178 (setq racer-cmd "/home/ram/.cargo/bin/racer")
180 (add-hook 'rust-mode-hook
183 (racer-turn-on-eldoc)
184 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
185 (set (make-local-variable 'company-backends) '(company-racer))
186 (local-set-key (kbd "M-.") #'racer-find-definition)
187 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
190 ;; (add-hook 'prog-mode-hook 'highlight-todos)
193 (setq ledger-binary-path "~/.cabal/bin/hledger")
196 (setq exec-path (cons "/usr/local/go/bin" exec-path))
197 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
199 (defun go-mode-setup ()
201 (setq gofmt-command "goimports")
202 (add-hook 'before-save-hook 'gofmt-before-save))
204 (add-hook 'go-mode-hook 'go-mode-setup)
206 ;; alias man to w.o.man
207 (defalias 'man 'woman)
210 (defun eshell/emacs (&rest args)
211 "open a file in emacs"
214 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
216 ;(desktop-save-mode 1)
220 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
223 (add-hook 'after-init-hook #'global-flycheck-mode)