3 ;; y-or-n instead of yes-or-no
4 (defalias 'yes-or-no-p 'y-or-n-p)
7 (require 'color-theme-sanityinc-tomorrow)
9 ;; Don't show startup msg, don't store tilde files
10 (setq make-backup-files nil)
11 (setq initial-scratch-message "")
12 (setq inhibit-startup-message t)
14 (setq initial-frame-alist (quote ((fullscreen . maximized))))
15 (setq send-mail-function (quote smtpmail-send-it))
17 ;; turn OFF syntax highlighting
18 ;; (global-font-lock-mode 0)
21 (setq-default cursor-type '(bar . 2))
24 (column-number-mode 1)
27 ;; (set-default-font "Inconsolata-12")
28 ;; (set-default-font "InconsolataGo-12")
30 (when (member "DejaVu Sans Mono" (font-family-list))
31 (set-face-attribute 'default nil :font "DejaVu Sans Mono-11"))
33 ;; Don't let Emacs hurt your ears
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")
57 (".*\\.oftc.net" "#leastauthority")
58 ;;(".*\\.mozilla.org" "#rust-beginners")
63 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
64 "324" "329" "332" "333" "353" "477"))
65 ;; don't show any of this
66 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
71 (when (y-or-n-p "Do you want to start IRC? ")
72 ;; (erc-tls :server "irc.mozilla.org" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
73 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
74 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
76 ;; switch to ERC with Ctrl+c e
77 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
80 (setq ido-enable-flex-matching t)
81 (setq ido-everywhere t)
84 ;; disable tabs for indentation
85 (setq-default indent-tabs-mode nil)
87 ;; (require 'whitespace)
88 ;; (setq whitespace-style '(face lines-tail))
89 ;; (setq whitespace-line-column 80)
90 ;; (global-whitespace-mode t)
92 ;; ;; show trailing whitespaces
93 ;; (setq-default show-trailing-whitespace t)
94 ;; (setq-default indicate-empty-lines t)
97 (setq c-default-style "k&r"
101 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
102 (add-to-list 'exec-path "~/.cabal/bin")
103 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
106 (require 'haskell-process)
107 (require 'haskell-interactive-mode)
108 (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
110 (setq haskell-process-suggest-remove-import-lines t)
111 (setq haskell-process-auto-import-loaded-modules t)
112 (setq haskell-process-log t)
114 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
115 (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
116 (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
117 (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
118 (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
119 (define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
120 (define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
123 ;;(autoload 'ghc-init "ghc" nil t)
124 ;;(autoload 'ghc-debug "ghc" nil t)
126 ;;(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
129 (add-to-list 'load-path "~/.emacs.d/hs-lint")
131 (defun my-haskell-mode-hook ()
132 (local-set-key "\C-cl" 'hs-lint))
134 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
137 (add-hook 'haskell-mode-hook #'hindent-mode)
140 (add-hook 'before-save-hook #'gofmt-before-save)
141 (add-hook 'go-mode-hook (lambda ()
142 (local-set-key (kbd "C-c C-r")
143 'go-remove-unused-imports)))
144 (add-hook 'go-mode-hook (lambda ()
145 (local-set-key (kbd "C-c i")
149 (add-to-list 'load-path "~/.emacs.d/asp-mode")
150 (autoload 'asp-mode "asp-mode")
151 (setq auto-mode-alist
152 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
155 (global-linum-mode t)
156 (global-hl-line-mode 0)
158 ;; fci -- fill-column-indicator
159 (setq fci-rule-column 81)
160 (setq fci-rule-width 1)
161 (setq fci-rule-color "darkblue")
163 ;; turn off electric-indent-mode
164 (when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
167 (setq mail-user-agent 'message-user-agent)
168 (setq user-mail-address "ram@rkrishnan.org"
169 user-full-name "Ramakrishnan Muthukrishnan")
172 (setq smtpmail-stream-type 'ssl
173 smtpmail-smtp-server "mail.messagingengine.com"
174 smtpmail-smtp-service 465)
177 (require 'notmuch-address)
178 (setq notmuch-address-command "/usr/bin/notmuch-addrlookup")
179 ;;(notmuch-address-message-insinuate)
182 (setq message-send-mail-function 'smtpmail-send-it)
186 (add-hook 'message-setup-hook 'mml-secure-message-sign-pgp)
189 ;; custom-set-faces was added by Custom.
190 ;; If you edit it by hand, you could mess it up, so be careful.
191 ;; Your init file should contain only one such instance.
192 ;; If there is more than one, they won't work right.
195 ;; company mode for auto completion
196 (add-hook 'after-init-hook 'global-company-mode)
198 ;; Reduce the time after which the company auto completion popup opens
199 (setq company-idle-delay 0.2)
201 ;; Reduce the number of characters before company kicks in
202 (setq company-minimum-prefix-length 1)
204 ;; Set path to racer binary
205 (setq racer-cmd "/home/ram/.cargo/bin/racer")
207 (add-hook 'rust-mode-hook
210 (racer-turn-on-eldoc)
211 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
212 (set (make-local-variable 'company-backends) '(company-racer))
213 (local-set-key (kbd "M-.") #'racer-find-definition)
214 (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
217 ;; (add-hook 'prog-mode-hook 'highlight-todos)
220 (setq ledger-binary-path "~/.cabal/bin/hledger")
223 (setq exec-path (cons "/usr/local/go/bin" exec-path))
224 (add-to-list 'exec-path (concat (getenv "GOPATH") "/bin"))
226 (defun go-mode-setup ()
228 (setq gofmt-command "goimports")
229 (add-hook 'before-save-hook 'gofmt-before-save))
231 (add-hook 'go-mode-hook 'go-mode-setup)
233 ;; alias man to w.o.man
234 (defalias 'man 'woman)
237 (defun eshell/emacs (&rest args)
238 "open a file in emacs"
241 (mapc #'find-file (mapcar #'expand-file-name (eshell-flatten-list (reverse args))))))
243 ;(desktop-save-mode 1)
247 (add-to-list 'which-func-modes '(c-mode c++-mode rust-mode haskell-mode))
250 (add-hook 'after-init-hook #'global-flycheck-mode)
253 (setq org-todo-keywords
254 '((sequence "TODO(t)" "INPROGRESS(p)" "WAITING(w)" "|" "DONE" "CANCELLED")))
256 (setq org-agenda-files '("~/src/org/"))
257 (add-to-list 'load-path "~/.emacs.d/elisp")
259 (require 'org-bullets)
260 (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
262 ;; key shortcut for org-agenda
263 (global-set-key (kbd "C-c a") 'org-agenda)