]> git.rkrishnan.org Git - .emacs.d.git/blob - init.el
a bunch of stuff from Jaseem's init.el
[.emacs.d.git] / init.el
1 (show-paren-mode 1)
2 ;; y-or-n instead of yes-or-no
3 (defalias 'yes-or-no-p 'y-or-n-p)
4
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)
9
10 ;; column number
11 (column-number-mode 1)
12
13 ;; Don't let Emacs hurt your ears
14 (setq visible-bell t)
15
16 ;; This is bound to f11 in Emacs 24.4
17 ;; (toggle-frame-fullscreen)
18 (custom-set-variables
19  '(initial-frame-alist (quote ((fullscreen . maximized)))))
20 ;; Who use the bar to scroll?
21 (when (display-graphic-p)
22   (progn
23     (scroll-bar-mode 0)
24
25     (tool-bar-mode 0)
26     (menu-bar-mode 0)))
27
28 ; my-packages.el
29 (require 'package)
30 (add-to-list 'package-archives
31              '("melpa" . "http://melpa.milkbox.net/packages/") t)
32 (add-to-list 'package-archives
33              '("marmalade" . "http://marmalade-repo.org/packages/") t)
34 (package-initialize)
35
36 ; fetch the list of packages available
37 (unless package-archive-contents
38   (package-refresh-contents))
39
40 ;; make sure my list of packages are installed
41 (setq package-list '(go-mode rust-mode haskell-mode clojure-mode ghc restclient tangotango-theme cider fill-column-indicator))
42
43 ; install the missing packages
44 (dolist (package package-list)
45   (unless (package-installed-p package)
46     (package-install package)))
47
48 ;; tangotango
49 ; (load-theme 'tangotango t)
50
51 (load-theme 'angel-light t)
52
53 ;; erc
54 (require 'erc)
55 (require 'tls)
56 ;; (setq tls-program '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"))
57
58 (erc-autojoin-mode t)
59 (setq erc-autojoin-channels-alist
60   '((".*\\.freenode.net" "#tahoe-lafs")
61     (".*\\.oftc.net" "#LeastAuthority")))
62
63 ;; check channels
64 (erc-track-mode t)
65 (setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
66
67                                  "324" "329" "332" "333" "353" "477"))
68 ;; don't show any of this
69 (setq erc-hide-list '("JOIN" "PART" "QUIT" "NICK"))
70
71 (defun start-erc ()
72   "Connect to IRC."
73   (interactive)
74   (when (y-or-n-p "Do you want to start IRC? ")
75     (erc-tls :server "irc.freenode.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")
76     (erc-tls :server "irc.oftc.net" :port 6697 :nick "rkrishnan" :full-name "Ramakrishnan Muthukrishnan")))
77
78 ;; switch to ERC with Ctrl+c e
79 (global-set-key (kbd "C-c e") 'start-erc) ;; ERC
80
81 ;; haskell mode
82 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH")))
83 (add-to-list 'exec-path "~/.cabal/bin")
84 (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
85 ;; (add-hook 'haskell-mode-hook 'haskell-indent-mode)
86 ;; (add-hook 'haskell-mode-hook 'interactive-haskell-mode)
87 ;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
88 (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
89
90 ;; ghc-mod
91 (autoload 'ghc-init "ghc" nil t)
92 (autoload 'ghc-debug "ghc" nil t)
93 (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
94 (custom-set-variables
95   '(haskell-process-type 'cabal-repl))
96
97 ;; ido
98 (setq ido-enable-flex-matching t)
99 (setq ido-everywhere t)
100 (ido-mode 1)
101
102 ;; disable tabs for indentation
103 (setq-default indent-tabs-mode nil)
104
105 ;; (require 'whitespace)
106 ;; (setq whitespace-style '(face lines-tail))
107 ;; (setq whitespace-line-column 80)
108 ;; (global-whitespace-mode t)
109
110 ;; ;; show trailing whitespaces
111 ;; (setq-default show-trailing-whitespace t)
112 ;; (setq-default indicate-empty-lines t)
113
114 ;; C style
115 (setq c-default-style "k&r"
116       c-basic-offset 4)
117
118 ;; hlint
119 (add-to-list 'load-path "~/.emacs.d/hs-lint")
120 (require 'hs-lint)
121 (defun my-haskell-mode-hook ()
122    (local-set-key "\C-cl" 'hs-lint))
123 (add-hook 'haskell-mode-hook 'my-haskell-mode-hook)
124
125 ;; gofmt
126 (add-hook 'before-save-hook #'gofmt-before-save)
127 (add-hook 'go-mode-hook (lambda ()
128                           (local-set-key (kbd "C-c C-r")
129                                          'go-remove-unused-imports)))
130 (add-hook 'go-mode-hook (lambda ()
131                           (local-set-key (kbd "C-c i")
132                                          'go-goto-imports)))
133
134 ;; asp
135 (add-to-list 'load-path "~/.emacs.d/asp-mode")
136 (autoload 'asp-mode "asp-mode")
137 (setq auto-mode-alist
138       (cons '("\\.asp\\'" . asp-mode) auto-mode-alist))
139
140 ;; line-number-mode
141 (global-linum-mode t)
142 (global-hl-line-mode t)
143
144 ;; fci -- fill-column-indicator
145 (setq fci-rule-column 81)
146 (setq fci-rule-width 1)
147 (setq fci-rule-color "darkblue")