-
Notifications
You must be signed in to change notification settings - Fork 9
/
init.el
687 lines (583 loc) · 20.4 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
;;; init.el --- Personal emacs configuration of Samuel Tonini
;; Copyright © 2014-2016 Samuel Tonini
;;
;; Author: Samuel Tonini <tonini.samuel@gmail.com>
;; Maintainer: Samuel Tonini <tonini.samuel@gmail.com>
;; URL: http://www.github.com/tonini/emacs.d
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Personal Emacs configuration of Samuel Tonini
;;; Code:
;;; Debugging
(setq message-log-max 10000)
;; Please don't load outdated byte code
(setq load-prefer-newer t)
;; Bootstrap `use-package'
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'bind-key)
(use-package diminish :ensure t)
;; Customization
(defconst tonini-custom-file (locate-user-emacs-file "customize.el")
"File used to store settings from Customization UI.")
(setq temporary-file-directory (expand-file-name "~/.emacs.d/tmp"))
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
(require 'tonini-utils)
(require 'tonini-keybindings)
(defun my-minibuffer-setup-hook ()
(setq gc-cons-threshold most-positive-fixnum))
(defun my-minibuffer-exit-hook ()
(setq gc-cons-threshold 800000))
(add-hook 'minibuffer-setup-hook #'my-minibuffer-setup-hook)
(add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook)
;;; User interface
;; Get rid of tool bar, menu bar and scroll bars. On OS X we preserve the menu
;; bar, since the top menu bar is always visible anyway, and we'd just empty it
;; which is rather pointless.
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when (and (eq system-type 'gnu/linux) (fboundp 'menu-bar-mode))
(menu-bar-mode -1))
(when (fboundp 'scroll-bar-mode)
(scroll-bar-mode -1))
(set-default 'truncate-lines t)
(set-default 'indent-tabs-mode nil)
(delete-selection-mode 1)
(transient-mark-mode 1)
;; No blinking and beeping, no startup screen, no scratch message and short
;; Yes/No questions.
(blink-cursor-mode 1)
(setq ring-bell-function #'ignore
inhibit-startup-screen t
echo-keystrokes 0.1
linum-format " %d"
initial-scratch-message "Howdy Sam!\n")
(fset 'yes-or-no-p #'y-or-n-p)
;; Opt out from the startup message in the echo area by simply disabling this
;; ridiculously bizarre thing entirely.
(fset 'display-startup-echo-area-message #'ignore)
(global-linum-mode)
(set-face-attribute 'default nil
:family "Source Code Pro" :height 160)
(set-face-attribute 'variable-pitch nil
:family "Fira Sans" :height 140 :weight 'regular)
(set-frame-parameter nil 'fullscreen 'fullboth)
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
;; (load-theme 'ujelly t)
(load-theme 'adwaita t)
;; utf-8 all the things
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; System setup
;; `gc-cons-threshold'
;; http://www.gnu.org/software/emacs/manual/html_node/elisp/Garbage-Collection.html
;;
;; I have a modern machine ;)
;;
(setq gc-cons-threshold 20000000)
(setq delete-old-versions t
make-backup-files nil
create-lockfiles nil
ring-bell-function 'ignore
auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
(server-start) ;; Allow this Emacs process to be a server for client processes.
(use-package page-break-lines ; Turn page breaks into lines
:ensure t
:init (global-page-break-lines-mode)
:diminish page-break-lines-mode)
(use-package cus-edit
:defer t
:config
(setq custom-file tonini-custom-file
custom-buffer-done-kill nil ; Kill when existing
custom-buffer-verbose-help nil ; Remove redundant help text
;; Show me the real variable name
custom-unlispify-tag-names nil
custom-unlispify-menu-entries nil)
:init (load tonini-custom-file 'no-error 'no-message))
(use-package smartparens
:ensure t
:init
(smartparens-global-mode)
(show-smartparens-global-mode)
(dolist (hook '(inferior-emacs-lisp-mode-hook
emacs-lisp-mode-hook))
(add-hook hook #'smartparens-strict-mode))
:config
(require 'smartparens-config)
(setq sp-autoskip-closing-pair 'always)
:bind
(:map smartparens-mode-map
("C-c s u" . sp-unwrap-sexp)
("C-c s w" . sp-rewrap-sexp))
:diminish (smartparens-mode))
(use-package ido
:config
(setq ido-enable-flex-matching t)
(ido-everywhere t)
(ido-mode 1))
(use-package hl-line
:init (global-hl-line-mode 1))
(use-package rainbow-delimiters
:ensure t
:defer t
:init
(dolist (hook '(text-mode-hook prog-mode-hook emacs-lisp-mode-hook))
(add-hook hook #'rainbow-delimiters-mode)))
(use-package hi-lock
:init (global-hi-lock-mode))
(use-package highlight-numbers
:ensure t
:defer t
:init (add-hook 'prog-mode-hook #'highlight-numbers-mode))
(use-package rainbow-mode
:ensure t
:bind (("C-c t r" . rainbow-mode))
:config (add-hook 'css-mode-hook #'rainbow-mode)
:diminish (rainbow-mode))
(use-package company ; Graphical (auto-)completion
:ensure t
:init (global-company-mode)
:config
(progn
(delete 'company-dabbrev company-backends)
(setq company-tooltip-align-annotations t
company-tooltip-minimum-width 27
company-idle-delay 0.3
company-tooltip-limit 10
company-minimum-prefix-length 3
company-tooltip-flip-when-above t))
:bind (:map company-active-map
("M-k" . company-select-next)
("M-i" . company-select-previous)
("TAB" . company-complete-selection))
:diminish company-mode)
(use-package ag
:ensure t
:commands (ag ag-regexp ag-project))
(use-package tester
:load-path "~/Projects/tester.el"
:commands (tester-run-test-file tester-run-test-suite))
(use-package helm
:ensure t
:bind (("M-a" . helm-M-x)
("C-x C-f" . helm-find-files)
("C-x f" . helm-recentf)
("C-SPC" . helm-dabbrev)
("M-y" . helm-show-kill-ring)
("C-x b" . helm-buffers-list))
:bind (:map helm-map
("M-i" . helm-previous-line)
("M-k" . helm-next-line)
("M-I" . helm-previous-page)
("M-K" . helm-next-page)
("M-h" . helm-beginning-of-buffer)
("M-H" . helm-end-of-buffer)
("<tab>" . helm-execute-persistent-action)
("C-i" . helm-execute-persistent-action))
:config (progn
(setq helm-buffers-fuzzy-matching t)
(helm-mode 1)
(setq helm-split-window-in-side-p t
helm-buffers-fuzzy-matching t
helm-move-to-line-cycle-in-source t
helm-ff-search-library-in-sexp t
helm-ff-file-name-history-use-recentf t
helm-ag-fuzzy-match t)
(substitute-key-definition 'find-tag 'helm-etags-select global-map)
(setq projectile-completion-system 'helm))
;; Display helm buffers always at the bottom
;; Source: http://www.lunaryorn.com/2015/04/29/the-power-of-display-buffer-alist.html
(add-to-list 'display-buffer-alist
`(,(rx bos "*helm" (* not-newline) "*" eos)
(display-buffer-reuse-window display-buffer-in-side-window)
(reusable-frames . visible)
(side . bottom)
(window-height . 0.4)))
:diminish (helm-mode))
(use-package helm-descbinds
:ensure t
:bind ("C-h b" . helm-descbinds))
(use-package helm-files
:bind (:map helm-find-files-map
("M-i" . nil)
("M-k" . nil)
("M-I" . nil)
("M-K" . nil)
("M-h" . nil)
("M-H" . nil)
("M-v" . yank)))
(use-package helm-swoop
:ensure t
:bind (("M-m" . helm-swoop)
("M-M" . helm-swoop-back-to-last-point))
:init
(bind-key "M-m" 'helm-swoop-from-isearch isearch-mode-map))
(use-package helm-ag
:ensure helm-ag
:bind ("M-p" . helm-projectile-ag)
:commands (helm-ag helm-projectile-ag)
:init (setq helm-ag-insert-at-point 'symbol
helm-ag-command-option "--path-to-ignore ~/.agignore")) ;
(use-package helm-info
:ensure helm
:bind (([remap info] . helm-info-at-point)
("C-c h e" . helm-info-emacs))
:config
;; Also lookup symbols in the Emacs manual
(add-to-list 'helm-info-default-sources
'helm-source-info-emacs))
(use-package helm-flycheck ; Helm frontend for Flycheck errors
:ensure t
:defer t
:after flycheck)
(use-package winner ; Undo and redo window configurations
:init (winner-mode))
(use-package desktop ; Save buffers, windows and frames
:disabled t
:init (desktop-save-mode)
:config
;; Save desktops a minute after Emacs was idle.
(setq desktop-auto-save-timeout 60)
;; Don't save Magit and Git related buffers
(dolist (mode '(magit-mode magit-log-mode))
(add-to-list 'desktop-modes-not-to-save mode))
(add-to-list 'desktop-files-not-to-save (rx bos "COMMIT_EDITMSG")))
(use-package multiple-cursors ; Edit text with multiple cursors
:ensure t
:bind (("C-c o <SPC>" . mc/vertical-align-with-space)
("C-c o a" . mc/vertical-align)
("C-c o e" . mc/mark-more-like-this-extended)
("C-c o h" . mc/mark-all-like-this-dwim)
("C-c o l" . mc/edit-lines)
("C-c o n" . mc/mark-next-like-this)
("C-c o p" . mc/mark-previous-like-this)
("C-c o r" . vr/mc-mark)
("C-c o C-a" . mc/edit-beginnings-of-lines)
("C-c o C-e" . mc/edit-ends-of-lines)
("C-c o C-s" . mc/mark-all-in-region))
:config
(setq mc/mode-line
;; Simplify the MC mode line indicator
'(:propertize (:eval (concat " " (number-to-string (mc/num-cursors))))
face font-lock-warning-face)))
;; (use-package autorevert ; Auto-revert buffers of changed files
;; :init (global-auto-revert-mode)
;; :config
;; (setq auto-revert-verbose nil ; Shut up, please!
;; ;; Revert Dired buffers, too
;; global-auto-revert-non-file-buffers t)
;; (when (eq system-type 'darwin)
;; ;; File notifications aren't supported on OS X
;; (setq auto-revert-use-notify nil))
;; :diminish (auto-revert-mode))
(use-package subword ; Subword/superword editing
:defer t
:diminish subword-mode)
(use-package ibuffer-vc ; Group buffers by VC project and status
:disabled t
:ensure t
:defer t
:init (add-hook 'ibuffer-hook
(lambda ()
(ibuffer-vc-set-filter-groups-by-vc-root)
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic)))))
(use-package projectile
:ensure t
:bind (("C-x p" . projectile-persp-switch-project))
:config
(setq projectile-completion-system 'helm)
(projectile-global-mode)
(helm-projectile-on)
(setq projectile-enable-caching nil)
:diminish (projectile-mode))
(use-package ibuffer-projectile ; Group buffers by Projectile project
:ensure t
:defer t
:init (add-hook 'ibuffer-hook #'ibuffer-projectile-set-filter-groups))
(use-package persp-projectile
:ensure t
:defer 1
:bind (("C-p s" . projectile-persp-switch-project))
:config
(persp-mode)
;; (defun persp-format-name (name)
;; "Format the perspective name given by NAME for display in `persp-modestring'."
;; (let ((string-name (format "%s" name)))
;; (if (equal name (persp-name persp-curr))
;; (propertize string-name 'face 'persp-selected-face))))
;; (defun persp-update-modestring ()
;; "Update `persp-modestring' to reflect the current perspectives.
;; Has no effect when `persp-show-modestring' is nil."
;; (when persp-show-modestring
;; (setq persp-modestring
;; (append '("[")
;; (persp-intersperse (mapcar 'persp-format-name (persp-names)) "")
;; '("]")))))
)
(use-package helm-projectile
:ensure t
:config
(helm-projectile-on))
(use-package elixir-mode
:load-path "~/Projects/emacs-elixir/"
:config (progn
(defun my-elixir-do-end-close-action (id action context)
(when (eq action 'insert)
(newline-and-indent)
(forward-line -1)
(indent-according-to-mode)))
(sp-with-modes '(elixir-mode)
(sp-local-pair "do" "end"
:when '(("SPC" "RET"))
:post-handlers '(:add my-elixir-do-end-close-action)
:actions '(insert)))))
(use-package yasnippet
:ensure t
:defer t
:config
(setq yas-snippet-dirs "~/.emacs.d/snippets")
(yas-global-mode 1)
:diminish (yas-minor-mode . " YS"))
(use-package alchemist
:defer 1
:load-path "~/Projects/alchemist.el/"
:bind (:map alchemist-iex-mode-map
("C-d" . windmove-right)
:map alchemist-mode-map
("M-w" . alchemist-goto-list-symbol-definitions))
:config (progn
(setq alchemist-goto-elixir-source-dir "~/Projects/elixir/")
(setq alchemist-goto-erlang-source-dir "~/Projects/otp/")
(defun tonini-alchemist-mode-hook ()
(tester-init-test-run #'alchemist-mix-test-file "_test.exs$")
(tester-init-test-suite-run #'alchemist-mix-test))
(add-hook 'alchemist-mode-hook 'tonini-alchemist-mode-hook)
;; Display alchemist buffers always at the bottom
;; Source: http://www.lunaryorn.com/2015/04/29/the-power-of-display-buffer-alist.html
(add-to-list 'display-buffer-alist
`(,(rx bos (or "*alchemist test report*"
"*alchemist mix*"
"*alchemist help*"
"*alchemist elixir*"
"*alchemist elixirc*"))
(display-buffer-reuse-window
display-buffer-in-side-window)
(reusable-frames . visible)
(side . right)
(window-width . 0.5)))))
(use-package erlang
:ensure t
:bind (:map erlang-mode-map ("M-," . alchemist-goto-jump-back))
:config
(setq erlang-indent-level 2))
(use-package enh-ruby-mode
:ensure t
:defer t
:mode (("\\.rb\\'" . enh-ruby-mode)
("\\.ru\\'" . enh-ruby-mode)
("\\.jbuilder\\'" . enh-ruby-mode)
("\\.gemspec\\'" . enh-ruby-mode)
("\\.rake\\'" . enh-ruby-mode)
("Rakefile\\'" . enh-ruby-mode)
("Gemfile\\'" . enh-ruby-mode)
("Guardfile\\'" . enh-ruby-mode)
("Capfile\\'" . enh-ruby-mode)
("Vagrantfile\\'" . enh-ruby-mode))
:config (progn
(setq enh-ruby-indent-level 2
enh-ruby-deep-indent-paren nil
enh-ruby-bounce-deep-indent t
enh-ruby-hanging-indent-level 2)
(setq ruby-insert-encoding-magic-comment nil)))
(use-package rubocop
:ensure t
:defer t
:init (add-hook 'ruby-mode-hook 'rubocop-mode))
(use-package rspec-mode
:ensure t
:defer t
:config (progn
(defun rspec-ruby-mode-hook ()
(tester-init-test-run #'rspec-run-single-file "_spec.rb$")
(tester-init-test-suite-run #'rake-test))
(add-hook 'enh-ruby-mode-hook 'rspec-ruby-mode-hook)))
(use-package rbenv
:ensure t
:defer t
:init (progn
(setq rbenv-show-active-ruby-in-modeline nil)
(global-rbenv-mode))
:config (progn
(global-rbenv-mode)
(add-hook 'enh-ruby-mode-hook 'rbenv-use-corresponding)))
(use-package f
:ensure t)
;;; OS X support
(use-package ns-win ; OS X window support
:defer t
:if (eq system-type 'darwin)
:config
(setq ns-pop-up-frames nil ; Don't pop up new frames from the
; workspace
mac-option-modifier 'meta ; Option is simply the natural Meta
mac-command-modifier 'meta ; But command is a lot easier to hit
mac-right-command-modifier 'left
mac-right-option-modifier 'none ; Keep right option for accented input
;; Just in case we ever need these keys
mac-function-modifier 'hyper))
;;; Environment fixup
(use-package exec-path-from-shell
:ensure t
:config
(progn
(exec-path-from-shell-initialize)
;; Re-initialize the `Info-directory-list' from $INFOPATH. Since package.el
;; already initializes info, we need to explicitly add the $INFOPATH
;; directories to `Info-directory-list'. We reverse the list of info paths
;; to prepend them in proper order subsequently
(with-eval-after-load 'info
(dolist (dir (nreverse (parse-colon-path (getenv "INFOPATH"))))
(when dir
(add-to-list 'Info-directory-list dir))))))
(use-package default-text-scale
:ensure t)
(use-package overseer
:ensure t
:init
(progn
(defun test-emacs-lisp-hook ()
(tester-init-test-run #'overseer-test-file "-test.el$")
(tester-init-test-suite-run #'overseer-test))
(add-hook 'overseer-mode-hook 'test-emacs-lisp-hook)))
(use-package karma
:ensure t
:init)
(use-package elisp-slime-nav
:ensure t
:init (add-hook 'emacs-lisp-mode-hook #'elisp-slime-nav-mode)
:diminish elisp-slime-nav-mode)
(use-package emacs-lisp-mode
:defer t
:interpreter ("emacs" . emacs-lisp-mode)
:bind (:map emacs-lisp-mode-map
("C-c e r" . eval-region)
("C-c e b" . eval-buffer)
("C-c e e" . eval-last-sexp)
("C-c e f" . eval-defun))
:diminish (emacs-lisp-mode . "EL"))
(use-package cask-mode
:ensure t
:defer t)
(use-package macrostep
:ensure t
:after elisp-mode
:bind (:map emacs-lisp-mode-map ("C-c m x" . macrostep-expand)
:map lisp-interaction-mode-map ("C-c m x" . macrostep-expand)))
(use-package ert
:after elisp-mode)
(use-package js2-mode
:ensure t
:mode (("\\.js\\'" . js2-mode)
("\\.js.erb\\'" . js2-mode)
("\\.jsx\\'" . js2-jsx-mode))
:bind (:map js2-mode-map
("M-j" . backward-char))
:config (setq js2-basic-offset 2))
(use-package typescript-mode
:ensure t
:config (setq typescript-indent-level 2))
(use-package coffee-mode
:ensure t
:mode (("\\.coffee\\'" . coffee-mode)
("\\.coffee.erb\\'" . coffee-mode)))
(use-package js2-refactor
:ensure t
:after js2-mode
:init
(add-hook 'js2-mode-hook 'js2-refactor-mode)
:config
(js2r-add-keybindings-with-prefix "C-c m r"))
(use-package company-tern
:disabled t
:ensure t
:after company)
(use-package flycheck
:ensure t
:defer 5
:config
(global-flycheck-mode 1)
:diminish (flycheck-mode))
(use-package drag-stuff
:ensure t
:config
(progn
(drag-stuff-global-mode 1)
(drag-stuff-define-keys)
))
(use-package magit
:ensure t
:defer 2
:bind (("C-x g" . magit-status))
:config
(progn
(delete 'Git vc-handled-backends)))
(use-package yaml-mode
:ensure t
:mode ("\\.ya?ml\\'" . yaml-mode))
(use-package web-mode
:ensure t
:mode (("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
("\\.html?\\'" . web-mode)
("\\.eex\\'" . web-mode)
("\\.php\\'" . web-mode))
:config (progn
(setq web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2)))
(use-package emmet-mode
:ensure t
:bind (:map emmet-mode-keymap
("M-e" . emmet-expand-line))
:config (add-hook 'web-mode-hook 'emmet-mode))
(use-package sass-mode
:ensure t)
(use-package scss-mode
:ensure t)
(use-package whitespace-cleanup-mode
:ensure t
:bind (("C-c t c" . whitespace-cleanup-mode)
("C-c x w" . whitespace-cleanup))
:init (dolist (hook '(prog-mode-hook text-mode-hook conf-mode-hook))
(add-hook hook #'whitespace-cleanup-mode))
:diminish (whitespace-cleanup-mode))
(use-package markdown-mode
:ensure t
:mode ("\\.md\\'" . markdown-mode))
(provide 'init)
;;; init.el ends here