2 ;; y-or-n instead of yes-or-no
3 (defalias 'yes-or-no-p 'y-or-n-p)
5 ;; Don't use messages that you don't rea
6 (setq make-backup-files nil)
7 (setq initial-scratch-message "")
8 (setq inhibit-startup-message t)
11 (setq-default cursor-type '(bar . 2))
14 (column-number-mode 1)
16 ;; Don't let Emacs hurt your ears
19 ;; This is bound to f11 in Emacs 24.4
20 ;; (toggle-frame-fullscreen)
22 '(initial-frame-alist (quote ((fullscreen . maximized)))))
23 ;; Who use the bar to scroll?
24 (when (display-graphic-p)
33 (add-to-list 'package-archives
34 '("melpa" . "http://melpa.milkbox.net/packages/") t)
35 (add-to-list 'package-archives
36 '("marmalade" . "http://marmalade-repo.org/packages/") t)
39 ; fetch the list of packages available
40 (unless package-archive-contents
41 (package-refresh-contents))
43 ;; make sure my list of packages are installed
44 (setq package-list '(go-mode rust-mode haskell-mode clojure-mode ghc restclient tangotango-theme cider fill-column-indicator paredit))
46 ; install the missing packages
47 (dolist (package package-list)
48 (unless (package-installed-p package)
49 (package-install package)))
52 (load-theme 'tangotango t)
57 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
60 (setq erc-autojoin-channels-alist
61 '((".*\\.freenode.net" "#tahoe-lafs")
62 (".*\\.oftc.net" "#LeastAuthority")))
66 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
68 "324" "329" "332" "333" "353" "477"))
69 ;; don't show any of this
70 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
75 (when (y-or-n-p "Do you want to start IRC? ")
76 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
77 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
79 ;; switch to ERC with Ctrl+c e
80 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
83 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
84 (add-to-list 'exec-path "~/.cabal/bin")
85 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
86 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
87 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
88 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
89 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
93 '(haskell-process-suggest-remove-import-lines t)
94 '(haskell-process-auto-import-loaded-modules t)
95 '(haskell-process-log t))
96 (eval-after-load 'haskell-mode '(progn
97 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
98 (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
99 (define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type)
100 (define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info)
101 (define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build)
102 (define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal)
103 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)))
104 (eval-after-load 'haskell-cabal '(progn
105 (define-key haskell-cabal-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
106 (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
107 (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
108 (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))
110 (eval-after-load 'haskell-mode
111 '(define-key haskell-mode-map (kbd "C-c C-o") 'haskell-compile))
112 (eval-after-load 'haskell-cabal
113 '(define-key haskell-cabal-mode-map (kbd "C-c C-o") 'haskell-compile))
115 (eval-after-load 'haskell-mode
116 '(define-key haskell-mode-map [f8] 'haskell-navigate-imports))
118 (custom-set-variables '(haskell-process-type 'cabal-repl))
121 (autoload 'ghc-init "ghc" nil t)
122 (autoload 'ghc-debug "ghc" nil t)
123 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
124 (custom-set-variables
125 '(haskell-process-type 'cabal-repl))
128 (setq ido-enable-flex-matching t)
129 (setq ido-everywhere t)
132 ;; disable tabs for indentation
133 (setq-default indent-tabs-mode nil)
135 ;; (require 'whitespace)
136 ;; (setq whitespace-style '(face lines-tail))
137 ;; (setq whitespace-line-column 80)
138 ;; (global-whitespace-mode t)
140 ;; ;; show trailing whitespaces
141 ;; (setq-default show-trailing-whitespace t)
142 ;; (setq-default indicate-empty-lines t)
145 (setq c-default-style "k&r"
149 (add-to-list 'load-path "~/.emacs.d/hs-lint")
151 (defun my-haskell-mode-hook ()
152 (local-set-key "\C-cl" 'hs-lint))
153 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
156 (add-hook 'before-save-hook #'gofmt-before-save)
157 (add-hook 'go-mode-hook (lambda ()
158 (local-set-key (kbd "C-c C-r")
159 'go-remove-unused-imports)))
160 (add-hook 'go-mode-hook (lambda ()
161 (local-set-key (kbd "C-c i")
165 (add-to-list 'load-path "~/.emacs.d/asp-mode")
166 (autoload 'asp-mode "asp-mode")
167 (setq auto-mode-alist
168 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
171 (global-linum-mode t)
172 (global-hl-line-mode t)
173 (set-face-background hl-line-face "#525252")
175 ;; fci -- fill-column-indicator
176 (setq fci-rule-column 81)
177 (setq fci-rule-width 1)
178 (setq fci-rule-color "darkblue")