forked from mattss/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.el
743 lines (643 loc) · 20.7 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
737
738
739
740
741
742
743
;;; init.el --- Init file for developement environment. -*- lexical-binding: t; coding: utf-8 -*-
;;; Commentary:
;;
;; Initialize Emacs configuration.
;;
;;; Code:
;; Packages managed with cask, so disable at startup.
(setq package-enable-at-startup nil)
(declare-function
#'mgrbyte-delete-trailing-blank-lines
"~/.emacs.d/lisp/mgrbyte.el")
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(setq package-archive-priorities
'(("gnu" . 0)
("melpa-stable" . 5)
("melpa" . 10)))
(eval-when-compile
(require 'use-package)
(require 'bind-key)
(require 'clojure-mode)
(require 'dash)
(require 'diminish)
(require 'f)
(require 'flycheck)
(require 'helm)
(require 'helm-files)
(require 'helm-lib)
(require 'helm-net)
;; (require 'jedi)
(require 'org)
(require 'org-agenda)
(require 'org-list)
(require 'reftex)
(require 'reftex-cite)
(require 'reftex-index)
(require 'tex-mode)
(require 's))
(use-package anaconda-mode
:config
(setq anaconda-mode-localhost-address "localhost"))
(use-package async
:functions async-byte-comp-get-allowed-pkgs)
(use-package all-the-icons)
(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
(use-package auth-source
:config
(setq auth-source-debug t)
(setq auth-sources (-filter #'file-exists-p '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc"))))
(use-package dockerfile-mode
:mode (("Dockerfile" . dockerfile-mode)))
(use-package helm-cider
:ensure t
:defer t
:after cider-mode)
(use-package helm-cider-history
:ensure t
:defer t
:after helm-cider
:init
(bind-key "C-l" #'helm-cider-history))
(use-package helm-config
:bind (("C-c h" . helm-command-prefix)
("C-x b" . helm-mini)
("C-x f" . helm-find-files)
("C-x C-r" . helm-recentf)
("M-x" . helm-M-x))
:preface
(progn
(require 'helm)
(unbind-key "C-x c")
(bind-key "<tab>" #'helm-execute-persistent-action helm-map)
(bind-key "C-e" #'recentf-edit-list helm-map)
(bind-key "C-z" #'helm-select-action helm-map))
:config
;; Don't ask to create new files.
(setq helm-ff-newfile-prompt-p nil)
;; open helm buffer inside current window, not occupy whole other window
(setq helm-split-window-inside-p t)
;; move to end or beginning of source when reaching top or bottom of source.
(setq helm-move-to-line-cycle-in-source t)
;; search for library in `require' and `declare-function' sexp.
(setq helm-ff-search-library-in-sexp t)
;; scroll 8 lines other window using M-<next>/M-<prior>s
(setq helm-scroll-amount 8)
(setq helm-buffers-fuzzy-matching t)
(setq helm-ff-file-name-history-use-recentf t)
(when (executable-find "curl")
(setq helm-net-prefer-curl t))
(when (executable-find "ack-grep")
(setq helm-grep-default-command
"ack-grep -Hn --no-group --no-color %e %p %f"
helm-grep-default-recurse-command
"ack-grep -H --no-group --no-color %e %p %f")))
(use-package org
:ensure t
:config
(progn
(defun mgrbyte--org-use-speed-commands-for-headings-and-lists ()
"Activate speed commands on list items too."
(or (and (looking-at org-outline-regexp) (looking-back "^\**" 100))
(save-excursion
(and (looking-at (org-item-re)) (looking-back "^[ \t]*" 100)))))
(defun mgrbyte--org-mode-ask-effort ()
"Ask for an effort estimate when clocking in."
(require 'org)
(unless (org-entry-get (point) "Effort")
(let ((effort
(completing-read
"Effort: "
(org-entry-get-multivalued-property (point) "Effort"))))
(unless (equal effort "")
(org-set-property "Effort" effort)))))
(setq org-log-done 'time)
(setq org-todo-keywords
(quote ((sequence
"TODO(t)"
"NEXT(n)"
"STARTED(s)"
"|"
"DONE(d)")
(sequence
"WAITING(w@/!)"
"HOLD(h@/!)"
"|"
"CANCELLED(c@/!)"
"PHONE"
"MEETING"))))
(setq org-default-notes-file "~/org/notes.org")
(setq org-agenda-files (f-entries "~/org" (apply-partially #'s-ends-with? ".org") t))
(setq org-directory "~/org")
(setq org-use-effective-time t)
(setq org-startup-folded t)
(setq org-cycle-include-plain-lists 'integrate)
(add-to-list 'org-speed-commands
'("x" org-todo "DONE"))
(add-to-list 'org-speed-commands
'("y" org-todo-yesterday "DONE"))
(add-to-list 'org-speed-commands
'("!" my/org-clock-in-and-track))
(add-to-list 'org-speed-commands
'("s" call-interactively 'org-schedule))
(add-to-list 'org-speed-commands
'("d" my/org-move-line-to-destination))
(add-to-list 'org-speed-commands
'("i" call-interactively 'org-clock-in))
(add-to-list 'org-speed-commands
'("o" call-interactively 'org-clock-out))
(add-to-list 'org-speed-commands
'("$" call-interactively 'org-archive-subtree))
;; (bind-key "!" 'my/org-clock-in-and-track org-agenda-mode-map)
(bind-key "C-c j" 'org-clock-goto) ;; jump to current task from anywhere
(bind-key "C-c C-w" 'org-refile)
(bind-key "C-c r" 'org-capture)
(bind-key "C-c a" 'org-agenda)
(bind-key "C-c l" 'org-store-link)
(bind-key "C-c L" 'org-insert-link-global)
(bind-key "C-c O" 'org-open-at-point-global)
(bind-key "C-TAB" 'org-cycle org-mode-map)
(bind-key "C-c v" 'org-show-todo-tree org-mode-map)
(bind-key "C-c C-r" 'org-refile org-mode-map)
(bind-key "C-c R" 'org-reveal org-mode-map)
(org-clock-persistence-insinuate)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
(clojure . t)))
(eval-after-load 'org-agenda
'(bind-key "i" 'org-agenda-clock-in org-agenda-mode-map)))
(add-hook 'org-clock-in-prepare-hook 'mgrbyte--org-mode-ask-effort))
(use-package persp-projectile
:config
(setq projectile-completion-system 'helm)
(setq projectile-sort-order 'recentf))
(use-package recentf
:bind (("C-x r e" . recentf-edit-list))
:config
;; Don't keep history of Cask updates in recent-f
(add-to-list 'recentf-exclude (expand-file-name "~/git/emacs.d/.cask.*")))
(use-package package
:bind (("C-c C-l" . list-packages)))
(use-package helm :diminish helm-mode)
(use-package helm-projectile
:bind (("C-x f" . projectile-find-file)
("C-x p g" . projectile-grep))
:config
(projectile-mode)
(helm-projectile-on)
(persp-mode))
(use-package mgrbyte
:load-path "lisp"
:bind (("C-x t w" . delete-trailing-whitespace)
("C-c f g" . find-grep-dired))
:config
;; encoding
(mgrbyte-configure-encoding 'utf-8)
;; VC
;; Follow links without asking
(setq-default vc-follow-symlinks 't)
(setq vc-handled-backends '(Git))
;; Misc settings.
(setq-default indent-line-function 'insert-tab)
(setq indent-tabs-mode nil)
(setq tab-always-indent nil)
;; Scrolling - do not add newlines when cursoring past last line in file
(setq scroll-step 1)
(setq next-line-add-newlines nil)
;; Display
(setq transient-mark-mode t)
(setq column-number-mode t)
(setq inhibit-startup-message t)
(setq search-highlight t)
(setq query-replace-highlight t)
(global-linum-mode 0)
;; Desktop mode
;; Useful for remembering a set of file you're working on -
;; - enables switching between projects and keeping state.
(setq desktop-save-mode t)
;; Misc settings
(setq mail-interactive t)
;; Annoyance factor
(fset 'yes-or-no-p 'y-or-n-p)
(setq font-lock-verbose nil)
(setq confirm-nonexistent-file-or-buffer nil)
;; Un-disable some 'dangerous!' commands
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(bind-key "C-c t" #'tool-bar-mode)
;; avoid audio beeping by turning on visible-bell
(setq visible-bell t)
(setq debug-on-error t)
(setq custom-theme-directory (locate-user-emacs-file "themes"))
(setq-default theme-load-from-file t)
(add-to-list 'auto-mode-alist '("Makfile.*" . makefile-gmake-mode))
(keyfreq-mode)
(menu-bar-mode 0)
(helm-mode 1))
(use-package tramp
:config
(setq tramp-default-method "ssh")
(setq tramp-default-remote-shell "/bin/zsh")
(setq tramp-encoding-shell "/bin/zsh")
(setq tramp-shell-prompt-pattern
"^[^$>\n]*[#$%>] *\\(\[[0-9;]*[a-zA-Z] *\\)*"))
(use-package bookmark
:config
(define-key global-map [menu-bar bookmarks]
(cons "Bookmarks" (make-sparse-keymap "Bookmarks")))
(define-key global-map
[menu-bar bookmarks bookmark-insert]
'("Insert bookmark into buffer" . bookmark-insert))
(define-key global-map
[menu-bar bookmarks bookmark-delete]
'("Delete bookmark" . bookmark-delete))
(define-key global-map
[menu-bar bookmarks bookmark-save]
'("Save bookmarks" . bookmark-save))
(define-key global-map
[menu-bar bookmarks list-bookmarks]
'("List bookmarks" . list-bookmarks))
(define-key global-map
[menu-bar bookmarks bookmark-set]
'("Add bookmark" . bookmark-sebt))
(define-key global-map
[menu-bar bookmarks bookmark-jump]
'("Goto bookmark" . bookmark-jump)))
(use-package cider-mode
:config
(setq cider-repl-use-pretty-printing 't)
(setq cider-repl-history-size 10000)
(setq cider-repl-history-file (f-join (getenv "HOME") ".cider-repl-history")))
(use-package conf-mode
:mode (("\\.conf" . conf-mode)
("\\.cfg" . conf-mode)
("\\.ini" . conf-mode)))
(use-package css-mode
:mode (("\\.css$" . css-mode)))
(use-package font-lock+
:load-path "lisp")
(use-package dashboard
:ensure t
:preface
(persp-mode)
:config
(setq dashboard-item-shortcuts '((agenda . "a")
(recents . "r")
(projects . "p")
(bookmarks . "m")))
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
(setq dashboard-set-file-icons t)
(setq dashboard-set-heading-icons t)
(setq dashboard-projects-switch-function 'projectile-persp-switch-project)
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(projects . 5)
(agenda . 5)))
(dashboard-setup-startup-hook))
;; (defun mgrbyte-dashboard-insert-custom (list-size)
;; (ignore list-size)
;; (insert (format "CIDER tip: %s" (cider-drink-a-sip))))
;; :config
;; (setq dashboard-items '((projects . 10)
;; (recents . 10)
;; (bookmarks . 10)))
;; (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
;; (add-to-list 'dashboard-item-generators '(custom . mgrbyte-dashboard-insert-custom))
;; (add-to-list 'dashboard-items '(custom) t)
;; (add-hook 'emacs-startup-hook '(lambda ()
;; (switch-to-buffer "*dashboard*")
;; (delete-other-windows)))
;; (dashboard-setup-startup-hook))
(use-package dired
:config
(defadvice dired-readin
(after dired-after-updating-hook first () activate)
"Sort dired listings with directories first before adding mark."
(mgrbyte-sort-directories-first)))
(use-package dired-x
:config
(setq-default dired-omit-files-p nil)
(setq dired-omit-files
(concat dired-omit-files "\\|^\\..+$")))
(use-package ediff
:config
(setq ediff-shell (getenv "$SHELL"))
(setq-default ediff-split-window-function
(quote split-window-vertically)))
(use-package editorconfig
:config
(editorconfig-mode 1))
(use-package emacs-lisp-mode
:mode (("*scratch*" . emacs-lisp-mode)
("\\.el$" . emacs-lisp-mode)))
(use-package erc)
(use-package flycheck
:preface
(declare-function flycheck-next-error flycheck nil)
(eval-after-load 'cider '(flycheck-clojure-setup))
(eval-after-load 'flycheck
'(setq flycheck-display-errors-function #'flycheck-pos-tip-error-messages))
(with-eval-after-load 'flycheck
(flycheck-pos-tip-mode))
(global-flycheck-mode 1)
(defun mgrbyte/flycheck-checker-name-on-mode-line (oldfun &optional status)
"Show the current checker name using OLDFUN and STATUS.
Result will be shown in the flycheck mode-line."
(let ((res (apply oldfun status)))
;; Unless there is no current checker
(if flycheck-checker
(s-replace "FlyC" (format "FlyC[%s]" flycheck-checker) res)
res)))
:config
(progn
(setq flycheck-emacs-lisp-load-path 'inherit)
(setq flycheck-flake8-maximum-line-length 79)
(setq flycheck-highlighting-mode 'lines)
(advice-add 'flycheck-mode-line-status-text
:around #'mgrbyte/flycheck-checker-name-on-mode-line)))
(use-package flycheck-clojure
:ensure t
:defer t
:after flycheck)
(use-package flycheck-clj-kondo
:ensure t)
;; Used for constributing 3rd party python packages
;; instead of the more imposing flycheck-flake8 checker
;;; (which is the default for my own and work packages)
(use-package flycheck-pyflakes)
(use-package flymake :disabled t)
(use-package frame-cmds
:bind (("C-c f m" . maximize-frame)
("C-c f r" . restore-frame)
("C-c f o" . other-window-or-frame)
("<M-up>" . move-frame-up)
("<M-down>" . move-frame-down)
("<M-left>" . move-frame-left)
("<M-right>" . move-frame-right)))
(use-package fringe
:after (mgrbyte)
:config
(when (mgrbyte-runs-X11)
(fringe-mode (quote (4 . 0)))))
(use-package menu-bar
:after (mgrbyte scroll-bar)
:config
;; Turn off UI elements
(mapc #'apply `((menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1)))
;; setup frame
(if (daemonp)
(add-hook 'after-make-frame-functions #'mgrbyte-setup-frame)
(mgrbyte-setup-frame)))
(use-package gist)
(use-package git-gutter+)
(use-package gnus
:bind (("C-x g" . gnus-other-frame)))
(use-package google-this)
(use-package ispell
:bind (("C-c i" . ispell-buffer))
:config
(mapc (lambda (envvar) (setenv envvar "en_GB.UTF8")) '("LANG" "LANGUAGE"))
(setq-default ispell-program-name "hunspell")
(let ((langs "cy_GB,en_GB"))
(setq ispell-dictionary langs)
(ispell-set-spellchecker-params)
(ispell-hunspell-add-multi-dic langs)
(setq ispell-personal-dictionary "~/.hunspell_personal")))
(use-package jinja2-mode
:mode (("\\.jinja$" . jinja2-mode)
("\\.html$" . jinja2-mode))
:config
(setq sgml-basic-offset 2))
(use-package js2-mode
:mode (("\\.js$" . js2-mode))
:config
(setq-default indent-tabs-mode nil))
(use-package json-mode
:mode (("\\.json$" . json-mode)))
(use-package java-mode
:mode (("\\.java$" . java-mode)))
;; (use-package jedi
;; :config
;; (setq jedi:complete-on-dot t))
(use-package keyfreq)
(use-package ls-lisp
:config (setq ls-lisp-use-insert-directory-program nil))
(use-package magit
:bind (("C-c m" . magit-status)))
(use-package mardown-mode
:mode (("\\.md$" . markdown-mode)))
(use-package mule
:after (mgrbyte)
:config
(mgrbyte-configure-encoding 'utf-8))
(use-package notify
:load-path "lisp")
(use-package nxml-mode
:mode (("\\.xml$" . nxml-mode)
("\\.zcml$" . nxml-mode))
:config
(add-hook 'nxml-mode-hook
(lambda ()
(setq indent-tabs-mode nil))))
(use-package paredit
:diminish paredit-mode
:init
(enable-paredit-mode)
:config
(unbind-key "M-s" paredit-mode-map)
(unbind-key "M-r" paredit-mode-map))
(use-package paren
:config
(setq show-paren-style 'expression)
:init
(show-paren-mode 1))
(use-package powerline
:config
(setq-default powerline-default-separator 'wave))
(use-package clojure-mode
:preface
(defun mgrbyte-setup-clj ()
(helm-cider-mode 1)
(yas-minor-mode 1))
:hook (mgrbyte-setup-clj)
:config
(require 'flycheck-clj-kondo)
(define-clojure-indent
(defroutes 'defun)
(GET 2)
(POST 2)
(PUT 2)
(DELETE 2)
(HEAD 2)
(ANY 2)
(context 2)))
(use-package python
:bind (("C-c d i" . py-insert-debug)
("RET" . newline-and-indent))
:mode (("\\.py$" . python-mode)
("\\.cpy$" . python-mode)
("\\.vpy$" . python-mode)
("\\.html$" . jinja2-mode))
:hook ((python-mode . anaconda-mode))
:config
(declare-function py-insert-debug mgrbyte nil)
(setq fill-column 79)
(setq-default flycheck-flake8rc "~/.config/flake8rc")
(setq python-check-command "flake8")
(setq tab-width 4)
(sphinx-doc-mode t))
(use-package pyautomagic
:load-path "lisp"
:bind (("C-c v e" . pyautomagic--activate-venv-safely)
("C-c f c" . pyautomagic--configureq-flycheck-checkers)))
;; (use-package virtualenvwrapper
;; :bind (("C-c w o" . venv-workon)
;; ("C-c w d" . venv-deactivate))
;; :preface
;; (defun mgrbyte/auto-activate-venv ()
;; (hack-local-variables)
;; (when (boundp 'mgrbyte-project-venv-name)
;; (venv-workon mgrbyte-project-venv-name)))
;; :config
;; (add-hook 'python-mode #'mgrbyte/auto-activate-venv)
;; (add-hook 'rst-mode #'mgrbyte/auto-activate-venv)
;; (setq-default mode-line-format
;; (append
;; mode-line-format
;; '(:exec venv-current-name))))
(use-package rainbow-delimiters
:config
(rainbow-delimiters-mode-enable))
(use-package rst
:config
(setq fill-column 79)
(setq rst-slides-program "google-chrome")
(setq rst-adornment-faces-alist
(quote ((nil . font-lock-keyword-face)
(nil . font-lock-keyword-face)
(nil . rst-level-1-face)
(2 . rst-level-2-face)
(3 . rst-level-3-face)
(4 . rst-level-4-face)
(5 . rst-level-5-face)
(nil . rst-level-5-face))))
:init
(auto-fill-mode t)
:mode (("\\.rst$" . rst-mode)))
(use-package sass-mode
:config (setq sass-indent-offset 2))
;; Emacs server configuration
;; Allows use with screen
;; Start either gnuserv or emacsserver for external access
(use-package server
:config
(setq server-socket-dir
(format "%semacs%d"
temporary-file-directory
(user-uid)))
(setq server-use-tcp 't)
:init
(when (not (or
(window-system)
(eq 'windows-nt system-type)))
(server-start)))
(use-package sgml-mode
:config
(setq sgml-basic-offset 2)
(add-hook 'sgml-mode-hook
(lambda ()
(setq indent-tabs-mode nil)))
:mode (("\\.pt$" . sgml-mode)
("\\.cpt$" . sgml-mode)))
(use-package shell
:config (setq shell-prompt-pattern "\\u@\\h: \\w $ "))
(use-package sql-mode
:mode (("\\.zsql$" . sql-mode)
("\\.sql$" . sql-mode)))
(use-package tex-mode
:preface
(defvar reftex-index-phrase-mode)
(defun turn-on-outline-minor-mode ()
"Turn on the outline minor mode."
(outline-minor-mode 1)
(setq outline-minor-mode-prefix "C-c C-o"))
:hook ((turn-on-outline-minor-mode turn-on-reftex))
:config
(setq-default
LaTeX-eqnarray-label "eq"
LaTeX-equation-label "eq"
LaTeX-figure-label "fig"
LaTeX-myChapter-label "chap"
LaTeX-section-hook '(LaTeX-section-heading
LaTeX-section-title
LaTeX-section-toc
LaTeX-section-section
LaTeX-section-label)
LaTeX-table-label "tab"
TeX-auto-save t
TeX-auto-save t
TeX-newline-function #'reindent-then-newline-and-indent
TeX-parse-self t
TeX-parse-self t
Tex-save-query nil)
(autoload #'reftex-mode "reftex" "RefTeX Minor Mode" t)
(autoload #'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
(autoload #'reftex-citation "reftex-cite" "Make citation" nil)
(autoload #'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t))
(use-package text
:mode (("\\.po$" . text-mode)
("\\.pot$" . text-mode)))
(use-package text-scale-mode
:bind (("C-c +" . text-scale-increase)
("C-c -" . text-scale-decrease)))
(use-package whitespace-cleanup-mode
:bind (("C-c _ w" . whitespace-mode)
("C-c _ t" . whitespace-toggle-options)
("C-c = w" . global-whitespace-mode)
("C-c = t" . global-whitespace-toggle-options))
:config
(setq-default whitespace-cleanup-mode-preserve-point 't)
(setq-default whitespace-cleanup-mode-only-if-initially-clean 't)
(setq-default whitespace-cleanup-mode-ignore-modes
'(cider-mode
cider-repl-mode
comint-mode
haskell-interactive-mode
helm-cider-mode
helm-mode
special-mode
view-mode)))
(use-package vcl
:mode (("\\.vcl" . vcl-mode)))
(use-package with-editor
:config
(setq with-editor-emacsclient-executable nil))
(use-package yaml-mode
:mode (("\\.yml" . yaml-mode)
("\\.yaml" . yaml-mode)))
;; Ensure PATH is preserved from shell.
(exec-path-from-shell-initialize)
;;; custom user Lisp (from template on first load)
(defvar user-custom-file (f-expand "~/.emacs-custom.el"))
(unless (f-exists? user-custom-file)
(with-current-buffer (get-buffer-create "user-custom-file")
(insert-file-contents
(locate-user-emacs-file "user-custom-file-template.el") nil 0)
(write-region (buffer-string) nil user-custom-file)))
(if (f-exists? user-custom-file)
(load user-custom-file))
;; Code generated by using the Emacs *customize* interfaces goes to its own file.
(setq custom-file (f-expand "~/.emacs-customize.el"))
(if (f-exists? custom-file)
(load custom-file))
;;; Load custom theme
(load-theme 'abyss 'no-confirm)
(provide 'init)
;;; init.el ends here