-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit.el
736 lines (637 loc) · 21.5 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
;; ------------------------------------
;; -*- Mode: Emacs-Lisp -*-
;; -*- lisp -*-
;; ~/.emacs.d/init.el
;; Jaseem Abid <[email protected]>
;; ------------------------------------
;; --------
;; Identity
;; --------
(setq init-file-user "jaseem"
user-full-name "Jaseem Abid"
user-nick "jaseemabid"
user-mail-address "[email protected]")
;; --------
;; Encoding
;; --------
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; ---------------
;; Custom Packages
;; ---------------
(setq package-archives
'(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/")))
;; Install all packages required
(load-file "~/.emacs.d/elpa-list.el")
(package-initialize)
;; Polyfill `package-install-selected-packages`, for Emacs < 25
(unless (fboundp 'package-install-selected-packages)
(progn
(require 'cl)
(defun package-install-selected-packages ()
(dolist (p package-selected-packages)
(when (not (package-installed-p p))
(package-install p))))))
;; Fetch packages the first time
(unless (file-exists-p package-user-dir)
(package-refresh-contents))
(package-install-selected-packages)
;; use-package.el is no longer needed at runtime
(eval-and-compile
(require 'use-package))
;; Set the paths early
(use-package exec-path-from-shell
:config
(setq exec-path-from-shell-check-startup-files nil)
(exec-path-from-shell-initialize))
;; Load lisp files from site-lisp
(push (expand-file-name "site-lisp" user-emacs-directory) load-path)
;; -----------------
;; General settings
;; -----------------
(setq-default c-basic-indent 4
c-basic-offset 4
c-default-style nil
case-fold-search t
column-number-mode t
create-lockfiles nil
fill-adapt-mode t
fill-column 80
indent-tabs-mode nil
initial-scratch-message nil
inhibit-startup-screen t
major-mode 'org-mode
mouse-autoselect-window t
next-line-add-newlines nil
nxml-child-indent 4
require-final-newline t
ring-bell-function 'ignore
sentence-end-double-space nil
tab-width 4
transient-mark-mode t
vc-follow-symlinks t
visible-bell t
truncate-lines t)
;; Make y/n suffice for yes/no q
(fset 'yes-or-no-p 'y-or-n-p)
;; ----------------------
;; Fonts and text styling
;; ----------------------
(setq font-lock-maximum-decoration t)
;; Larger fonts for the mac
;; Font setup with Fira
(when (window-system)
(set-frame-font "Inconsolata-14"))
;; Snippets
(load-file "~/.emacs.d/snippets.el")
;; Prevent accidentally suspending the frame
(unbind-key "C-x C-z")
;; Always split horizontally
(setq split-height-threshold most-positive-fixnum)
;; Keeping windows always balanced
;; http://blog.danielgempesaw.com/post/45400072065/keeping-my-emacs-windows-balanced
(progn
(defadvice split-window-below (after restore-balanace-below activate)
(balance-windows))
(defadvice split-window-right (after restore-balance-right activate)
(balance-windows))
(defadvice delete-window (after restore-balance activate)
(balance-windows)))
;; Never bother to show *compilation* window. It's annoying
(setq display-buffer-alist
'(("\\*compilation\\*" display-buffer-no-window (nil))))
;; Mac specific stuff
(when (eq system-type 'darwin)
;; "Mac hook"
(setq mac-command-modifier 'control
mac-option-modifier 'meta
ns-use-srgb-colorspace t
ns-alternate-modifier 'meta
ns-auto-hide-menu-bar nil
ns-command-modifier 'control
ns-control-modifier 'control
ns-function-modifier 'hyper)
;; Set single keys shortcuts for most common operations
(bind-key "H--" 'split-window-below)
(bind-key "H-\\" 'split-window-right)
(bind-key "H-k" 'kill-this-buffer)
(bind-key "H-l" 'sort-lines)
(bind-key "H-n" 'flycheck-next-error)
(bind-key "H-o" 'find-file)
(bind-key "H-p" 'flycheck-previous-error)
(bind-key "H-s" 'occur)
(bind-key "H-t" 'transpose-windows))
;; No bars and buttons on linux, show a menu bar on mac anyway
(if (eq system-type 'darwin)
(menu-bar-mode t)
(menu-bar-mode -1))
(when window-system
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1))
;; backup files
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
;; ---------------
;; Top level hooks
;; --------------
(use-package files
:init
(add-hook 'find-file-hook 'j/find-file-large-hook)
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
(remove-hook 'find-file-hook 'vc-find-file-hook)
(defun j/find-file-large-hook ()
"If a file is over a given size, make the buffer read only."
(when (> (buffer-size) (* 1024 1024))
(setq buffer-read-only t)
(buffer-disable-undo)
(fundamental-mode))))
;; ----------------
;; auto-mode-alists
;; ----------------
(add-to-list 'auto-mode-alist '("\\._\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.ext\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.less\\'" . less-css-mode))
(add-to-list 'auto-mode-alist '("\\.mako\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.hdl\\'" . vhdl-mode))
(add-to-list 'auto-mode-alist '("\\.scss\\'" . css-mode))
(add-to-list 'auto-mode-alist '("\\.txt\\'" . org-mode))
(add-to-list 'auto-mode-alist '("mutt-.*-" . mail-mode))
;; ------------------
;; Custom keybindings
;; ------------------
;; Buffer management
;; Switch to previously open buffer
(bind-key "C-c <left>" 'mode-line-other-buffer)
(bind-key "C-c <right>" 'mode-line-other-buffer)
(bind-key "C-c b" 'bury-buffer)
(bind-key "C-c n" 'mode-line-other-buffer)
(bind-key "C-x <down>" 'windmove-down)
(bind-key "C-x <left>" 'windmove-left)
(bind-key "C-x <right>" 'windmove-right)
(bind-key "C-x <up>" 'windmove-up)
(bind-key "C-x |" 'split-window-right)
(bind-key "C-x -" 'split-window-below)
;; eval and replace
(bind-key "C-c e" 'eval-and-replace)
;; powerful counterparts ?
(bind-key "C-s" 'isearch-forward-regexp)
(bind-key "C-r" 'isearch-backward-regexp)
(bind-key "C-M-s" 'isearch-forward)
(bind-key "C-M-r" 'isearch-backward)
;; navigation bindings
(bind-key "M-p" 'backward-paragraph)
(bind-key "M-n" 'forward-paragraph)
;; sorting and aligning
(bind-key "M-s a" 'align-regexp)
(bind-key "M-s l" 'sort-lines)
(bind-key "M-s r" 'reverse-region)
;; string-replace
(bind-key "C-l" 'replace-string)
;; copy word at point
(bind-key "C-c w" 'copy-word)
;; ----------------------
;; Package customizations
;; ----------------------
(use-package abbrev
:diminish abbrev-mode
:config
;; stop asking whether to save newly added abbrev when quitting emacs
(setq save-abbrevs nil)
(setq-default abbrev-mode t)
(define-abbrev-table 'global-abbrev-table
'(
;; math/unicode symbols
("8N" "ℕ")
("8R" "ℝ")
("8Sig" "Σ")
("8bot" "⟂")
("8gam" "Γ")
("8in" "∈")
("8inf" "∞")
("8inr" "₹")
("8lam" "λ")
("8lar" "←")
("8luv" "♥")
("8meh" "¯\\_(ツ)_/¯")
("8nin" "∉")
("8no" "❌")
("8ok" "✓")
("8rar" "→")
("8rs" "₹")
("8sig" "σ")
("8smly" "☺")
("8star" "★")
("8t" "#+TITLE:")
("8tau" "τ")
;; email
("8me" "[email protected]")
("8i" "Jaseem Abid")
;; normal english words
("8alt" "alternative")
("8char" "character")
("8def" "definition")
("8bg" "background")
("8kb" "keyboard")
("8ex" "example")
("8env" "environment")
("8var" "variable")
("8cp" "computer"))))
(use-package ace-jump-mode
:bind ("C-c SPC" . ace-jump-mode))
(use-package auto-complete
:bind ("M-/" . auto-complete)
:diminish auto-complete-mode
:config
(ac-config-default)
(add-to-list 'ac-dictionary-directories "~/.aspell.en.pws")
(ac-flyspell-workaround)
(add-to-list 'ac-modes 'git-commit-mode)
(add-to-list 'ac-modes 'org-mode))
(use-package auto-highlight-symbol
:diminish auto-highlight-symbol-mode
:config
(setq ahs-idle-interval 0.2)
(add-hook 'prog-mode-hook 'auto-highlight-symbol-mode)
(setq ahs-default-range 'ahs-range-whole-buffer))
(use-package bookmark
:bind-keymap ("C-x m" . bookmark-map))
(use-package delsel
:config
;; type over a region
(pending-delete-mode t))
(use-package desktop
:bind ("C-c s" . desktop-save-in-desktop-dir)
:init
(setq desktop-files-not-to-save "^$"
desktop-load-locked-desktop t
desktop-path '("~/.emacs.d/")
desktop-save t)
(desktop-save-mode t)
(add-to-list 'desktop-modes-not-to-save 'dired-mode)
(add-to-list 'desktop-modes-not-to-save 'help-mode)
(add-to-list 'desktop-modes-not-to-save 'fundamental-mode)
(add-to-list 'desktop-modes-not-to-save 'completion-list-mode))
(use-package fic-mode
:config
(setq fic-highlighted-words '("TODO" "BUG" "VERIFY" "NOTE" "XXX"))
(add-hook 'prog-mode-hook 'fic-mode))
(use-package dired
:bind (("C-x C-d" . dired)
("C-x d" . j/dired-open-here)
:map dired-mode-map
("r" . j/dired-open-external))
:config
;; Set the name of the host and current path/file in title bar:
(setq frame-title-format "%b")
(defun j/dired-open-here ()
"Open current directory."
(interactive)
(dired (file-name-directory (or buffer-file-name "~/"))))
(defun j/dired-open-external ()
"In dired, open the file named on this line with external tool."
(interactive)
(let* ((file (dired-get-filename nil t)))
(call-process "open" nil 0 nil file))))
(use-package dired-details
:config
(dired-details-install)
(setq dired-details-hidden-string ""))
(use-package ediff
:config
(setq ediff-split-window-function 'split-window-horizontally
ediff-window-setup-function 'ediff-setup-windows-plain))
(use-package edts
:diminish edts-mode
:disabled t
:init
(setq edts-doc-style 'buffer
edts-inhibit-package-check t
edts-man-root "~/.emacs.d/edts/doc/18.2.1")
(add-hook 'after-init-hook
(defun j/edts-setup ()
(require 'edts-start)
(use-package eproject-extras
:demand t
:diminish eproject-mode
:bind (:map eproject-mode-map ("C-c b" . bury-buffer))))))
(use-package emacs-lisp-mode
:bind (("M-." . find-function-at-point)
("C-h C-f" . find-function))
:config
(add-hook 'emacs-lisp-mode-hook (lambda () (setq mode-name "ξ"))))
(use-package erlang
:disabled t
:init
(add-to-list 'auto-mode-alist '("\\.P\\'" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.E\\'" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.S\\'" . erlang-mode))
:bind (:map erlang-mode-map ("C-c l" . magit-log-head))
:config
(add-hook 'erlang-mode-hook
(lambda ()
(setq mode-name "erl"
erlang-compile-extra-opts '((i . "../include"))
erlang-root-dir "/usr/local/lib/erlang"))))
(use-package etags
:config
(setq tags-revert-without-query t))
(use-package face-remap
:bind (("M-+" . text-scale-adjust)
("M--" . text-scale-adjust)
("M-0" . text-scale-adjust)))
(use-package files
:bind ("<f5>" . j/revert)
:config
(defun j/revert ()
(interactive)
(revert-buffer t t)))
(use-package fill-column-indicator
:config
(setq fci-rule-column 81)
(add-hook 'prog-mode-hook 'fci-mode))
(use-package flycheck
:bind (("<f9>" . flycheck-list-errors) ;; Magnifying glass
("<f4>" . flycheck-previous-error) ;; Media Prev
("<f6>" . flycheck-next-error)) ;; Media Next
:diminish flycheck-mode
:config
(add-hook 'after-init-hook 'global-flycheck-mode)
(setq flycheck-display-errors-function nil
flycheck-erlang-include-path '("../include")
flycheck-erlang-library-path '("../_build/default/lib/coracle/ebin")
flycheck-check-syntax-automatically '(save)
flycheck-disabled-checkers '(emacs-lisp-checkdoc)))
(use-package flyspell
:bind (("C-c f" . flyspell-buffer)
("C-." . flyspell-correct-word-before-point))
:diminish flyspell-mode
:config
(setq ispell-program-name "aspell")
(add-hook 'text-mode-hook 'auto-fill-mode)
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode))
(use-package god-mode
:bind ("<escape>" . god-local-mode)
:config
(defvar j/god-cursor-enabled "red")
(defvar j/god-cursor-disabled (cdr (assoc 'cursor-color (frame-parameters))))
(defun j/god-cursor ()
(set-cursor-color (if (or god-local-mode buffer-read-only)
j/god-cursor-enabled
j/god-cursor-disabled)))
(add-hook 'god-mode-enabled-hook 'j/god-cursor)
(add-hook 'god-mode-disabled-hook 'j/god-cursor))
(use-package intero
:config
(add-hook 'haskell-mode-hook 'intero-mode))
(use-package hindent
:config
(add-hook 'haskell-mode-hook 'hindent-mode))
(use-package haskell-mode
:config
(setq haskell-compile-cabal-build-command "cd %s && stack build"
haskell-compile-cabal-build-alt-command "cd %s && stack build"
haskell-compile-command "stack build")
(add-hook 'haskell-mode-hook 'haskell-indentation-mode)
(add-hook 'haskell-mode-hook
(lambda ()
(setq haskell-indent-spaces 4
haskell-indentation-left-offset 4
haskell-indentation-starter-offset 4
haskell-indentation-where-post-offset 2
haskell-indentation-where-pre-offset 2
haskell-tags-on-save t)
;; Ignore compiled Haskell files in filename completions
(add-to-list 'completion-ignored-extensions ".hi")))
;; Haskell shell stuff
(eval-after-load "haskell-mode"
'(progn
(set-register ?u "undefined")
(setq haskell-interactive-popup-errors nil)
(bind-keys :map haskell-mode-map
("C-c C-b" . haskell-interactive-switch)
("C-c C-d" . nil)
("C-c C-i" . haskell-process-do-info)
("C-c C-l" . haskell-process-load-file)
("C-c C-t" . haskell-process-do-type)
("C-c C-z" . haskell-interactive-switch)
("M-." . haskell-mode-jump-to-def)))))
(use-package ibuffer
:bind ("C-x C-b" . ibuffer)
:config
(setq ibuffer-formats
'((mark modified read-only " "
(name 30 30 :left :elide) " "
(size 9 -1 :right) " "
(mode 16 16 :left :elide) " " filename-and-process)
(mark " " (name 16 -1) " " filename))))
(use-package ido
:config
(setq ido-all-frames 'visible
ido-case-fold t
ido-create-new-buffer 'prompt)
(ido-mode 1)
(ido-everywhere 1)
(use-package flx-ido
:config
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil))
(use-package ido-vertical-mode
:bind (:map bookmark-map ("b" . ido-bookmark-jump))
:config
(ido-vertical-mode 1)
(setq ido-vertical-define-keys 'C-n-C-p-up-and-down)
(defun ido-bookmark-jump ()
"*Switch to bookmark interactively using `ido'."
(interactive)
(bookmark-jump
(ido-completing-read "Bookmark: " (bookmark-all-names)))))
(use-package ido-ubiquitous
:config
(ido-ubiquitous-mode 1)))
(use-package jedi
:config
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t
jedi:use-shortcuts t
jedi:environment-root "jedi"
python-environment-directory "~/.virtualenvs"))
(use-package js2-mode
:bind (("C-c d" . j/js-insert-debugger)
("M-RET" . electric-indent-just-newline))
:init
(defalias 'js-mode 'js2-mode)
:config
(defun j/js-insert-debugger ()
"Insert a debugger statement at point"
(interactive)
(insert "debugger;"))
(add-hook 'js2-mode-hook
(lambda () (setq mode-name "JS2")))
(setq-default js-indent-level 4
js2-allow-keywords-as-property-names t
js2-auto-insert-catch-block t
js2-concat-multiline-strings t
js2-global-externs '("$")
js2-highlight-level 3
js2-include-browser-externs t
js2-include-node-externs t))
(use-package ledger-mode
:disabled t
:mode "\\.ledger\\'"
:config
(setq ledger-post-use-completion-engine :ido
ledger-use-iso-dates t))
(use-package magit
:bind (("C-c i" . magit-status)
("C-c C-i" . magit-status)
("C-c g" . magit-status)
:map prog-mode-map
("C-c l" . magit-log-head)
:map dired-mode-map
("C-c l" . magit-log-head))
:config
(setq magit-process-connection-type nil
magit-push-always-verify nil
magit-revision-show-gravatars nil
process-connection-type nil)
(add-to-list 'desktop-modes-not-to-save 'magit-mode)
(add-hook 'magit-log-edit-mode-hook 'flyspell-mode))
(use-package multiple-cursors
:bind (("C-<" . mc/mark-previous-like-this)
("C->" . mc/mark-next-like-this)
("C-S-c C-S-c" . mc/edit-lines)
("C-c C-<" . mc/mark-all-like-this)))
(use-package newcomment
:bind ("C-c c" . comment-or-uncomment-region))
(use-package org
:bind (("C-c a" . org-agenda)
("C-c k" . org-store-link)
("C-c r" . org-capture)
:map org-mode-map
("C-c l" . j/org-insert-link))
:config
(setq org-agenda-files `("~/Notes")
org-agenda-timegrid-use-ampm t ;; 12hr format for agenda view
org-completion-use-ido t
org-default-notes-file "~/Notes/todo.org"
org-directory "~/Notes"
org-log-done 'time
org-return-follows-link t
org-src-fontify-natively t
org-startup-folded nil
org-capture-templates
'(("t" "Add personal todo" entry (file+headline "~/Notes/todo.org" "Tasks")
"* TODO %?\n %i"
:kill-buffer t
:empty-lines 1)
("w" "Add a work todo" entry (file+headline "~/Notes/work.org" "Tasks")
"* TODO %?\n %i"
:kill-buffer t)
("r" "Refile" plain (file "~/Notes/refile.org")
"%?\n %i"
:kill-buffer t)
("b" "Reading" entry (file+headline "~/Notes/reading.org" "Reading")
"** %^{title}\n %T\n\n%?"
:kill-buffer t)
("j" "Journal" plain (file (format "%s%s.org" "~/Notes/Journal/"
(format-time-string "%Y %m %d")))
"%U\n\n%?%i"
:kill-buffer t
:unnarrowed t))))
(use-package paredit
:diminish paredit-mode
:config
(add-hook 'scheme-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode))
(use-package paren
:config (show-paren-mode t))
(use-package projectile
:diminish projectile-mode
:commands projectile-mode
:bind-keymap ("C-c p" . projectile-command-map)
:init (setq projectile-mode-line "")
:config (projectile-mode))
(use-package python
:mode ("\\.py\\'" . python-mode)
:interpreter ("python" . python-mode)
:bind (:map python-mode-map
("M-n" . python-nav-forward-defun)
("M-p" . python-nav-backward-defun))
:config
(setq-default python-fill-docstring-style 'pep-257-nn)
(add-hook 'python-mode-hook (lambda () (setq mode-name "Py")))
(set-register ?d "import ipdb; ipdb.set_trace()"))
(use-package rainbow-mode
:config
(add-hook 'css-mode-hook 'rainbow-mode)
(add-hook 'html-mode-hook 'rainbow-mode))
(use-package recentf
:bind ("C-x C-r" . recentf-open-files)
:init
(recentf-mode 1))
(use-package rect
:config
(defalias 'rectangle-insert-string 'string-insert-rectangle))
(use-package restclient
:mode ( "\\.rest\\'" . restclient-mode))
(use-package saveplace
:config
(setq-default save-place t)
(setq save-place-file "~/.emacs.d/places"))
(use-package server
:config
(unless (server-running-p)
(server-start)))
(use-package sgml-mode
:bind (("<M-left>" . sgml-skip-tag-backward)
("<M-right>" . sgml-skip-tag-forward))
:config
(add-hook 'html-mode-hook
(lambda ()
(set (make-local-variable 'sgml-basic-offset) 2)
(set (make-local-variable 'tab-width) 2))))
(use-package smex
:bind (("M-x" . smex)
("M-X" . smex-major-mode-commands)
("C-c C-c M-x" . execute-extended-command))
:init
(when (eq window-system 'x)
(shell-command "xmodmap -e 'clear Lock' -e 'keycode 66 = F13'")))
(use-package subword
:diminish superword-mode
:config (global-superword-mode t))
(use-package tramp
:config
(setq tramp-auto-save-directory "~/.emacs.d/auto-save-list"
tramp-completion-reread-directory-timeout nil
tramp-connection-timeout 30
tramp-default-host "localhost"
tramp-default-method "scp"))
(use-package uniquify
:config
(setq uniquify-buffer-name-style 'forward
uniquify-min-dir-content 1))
(use-package virtualenvwrapper
:config
(venv-initialize-interactive-shells)
(venv-initialize-eshell))
(use-package material
:config
(load-theme 'material t))
(require 'dot-toggle)
(require 'dot-lambda-fontify)
;; Private setup, passwords and key, if it exists.
(load "~/.emacs.d/private.el" 'noerror)
;; Note, load ERC only after private
(load-file "~/.emacs.d/erc.el")
(load-file "~/.emacs.d/eshell/init.el")
;; Load customized config
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)