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
56 ; install the missing packages
57 (dolist (package package-list)
58 (unless (package-installed-p package)
59 (package-install package)))
62 ; (load-theme 'tangotango t)
63 (load-theme 'leuven t)
68 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
71 (setq erc-autojoin-channels-alist
72 '((".*\\.freenode.net" "#tahoe-lafs")
73 (".*\\.oftc.net" "#LeastAuthority")))
77 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
79 "324" "329" "332" "333" "353" "477"))
80 ;; don't show any of this
81 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
86 (when (y-or-n-p "Do you want to start IRC? ")
87 (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
88 (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
90 ;; switch to ERC with Ctrl+c e
91 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
94 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
95 (add-to-list 'exec-path "~/.cabal/bin")
96 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
97 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
98 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
99 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
100 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
103 (custom-set-variables
104 '(haskell-process-suggest-remove-import-lines t)
105 '(haskell-process-auto-import-loaded-modules t)
106 '(haskell-process-log t))
107 (eval-after-load 'haskell-mode '(progn
108 (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
109 (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
110 (define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type)
111 (define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info)
112 (define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build)
113 (define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal)
114 (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)))
115 (eval-after-load 'haskell-cabal '(progn
116 (define-key haskell-cabal-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
117 (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
118 (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
119 (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))
121 (eval-after-load 'haskell-mode
122 '(define-key haskell-mode-map (kbd "C-c C-o") 'haskell-compile))
123 (eval-after-load 'haskell-cabal
124 '(define-key haskell-cabal-mode-map (kbd "C-c C-o") 'haskell-compile))
126 (eval-after-load 'haskell-mode
127 '(define-key haskell-mode-map [f8] 'haskell-navigate-imports))
129 (custom-set-variables '(haskell-process-type 'cabal-repl))
132 (autoload 'ghc-init "ghc" nil t)
133 (autoload 'ghc-debug "ghc" nil t)
134 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
135 (custom-set-variables
136 '(haskell-process-type 'cabal-repl))
139 (setq ido-enable-flex-matching t)
140 (setq ido-everywhere t)
143 ;; disable tabs for indentation
144 (setq-default indent-tabs-mode nil)
146 ;; (require 'whitespace)
147 ;; (setq whitespace-style '(face lines-tail))
148 ;; (setq whitespace-line-column 80)
149 ;; (global-whitespace-mode t)
151 ;; ;; show trailing whitespaces
152 ;; (setq-default show-trailing-whitespace t)
153 ;; (setq-default indicate-empty-lines t)
156 (setq c-default-style "k&r"
160 (add-to-list 'load-path "~/.emacs.d/hs-lint")
162 (defun my-haskell-mode-hook ()
163 (local-set-key "\C-cl" 'hs-lint))
164 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
167 (add-hook 'before-save-hook #'gofmt-before-save)
168 (add-hook 'go-mode-hook (lambda ()
169 (local-set-key (kbd "C-c C-r")
170 'go-remove-unused-imports)))
171 (add-hook 'go-mode-hook (lambda ()
172 (local-set-key (kbd "C-c i")
176 (add-to-list 'load-path "~/.emacs.d/asp-mode")
177 (autoload 'asp-mode "asp-mode")
178 (setq auto-mode-alist
179 (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
182 (global-linum-mode t)
183 (global-hl-line-mode t)
185 ;; fci -- fill-column-indicator
186 (setq fci-rule-column 81)
187 (setq fci-rule-width 1)
188 (setq fci-rule-color "darkblue")