-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemacs.el
930 lines (846 loc) · 33.6 KB
/
emacs.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
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
;;;; Customize ;;;;
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-names-vector ["#3f3f3f" "#cc9393" "#7f9f7f" "#f0dfaf" "#8cd0d3" "#dc8cc3" "#93e0e3" "#dcdccc"])
'(custom-safe-themes t)
'(fci-rule-color "#383838")
'(font-lock-maximum-decoration (quote ((org-mode) (tex-mode) (t . t))))
'(safe-local-variable-values (quote ((eval ignore-errors "Write-contents-functions is a buffer-local alternative to before-save-hook" (add-hook (quote write-contents-functions) (lambda nil (delete-trailing-whitespace) nil)) (require (quote whitespace)) "Sometimes the mode needs to be toggled off and on." (whitespace-mode 0) (whitespace-mode 1)) (whitespace-line-column . 80) (whitespace-style face tabs trailing lines-tail) (require-final-newline . t) (company-clang-arguments "-I/home/dralston/src/navsim/RG5/bootloader/include/")))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;;;; File-Wide Macros ;;;;
(defmacro add-hook-progn (hook &rest body)
`(add-hook ,hook
(lambda () . ,body)))
(defmacro after-init (&rest body)
`(add-hook 'after-init-hook
(lambda () ,body)))
(defmacro req-packages (pkg-defs)
`(progn
,@(mapcar (lambda (pkg-def) (cons 'req-package pkg-def))
(symbol-value pkg-defs))))
;; Startup & Shutdown
(setq
inhibit-startup-screen t
initial-scratch-message ""
confirm-kill-emacs 'y-or-n-p)
(ignore-errors
(scroll-bar-mode 0)
(tool-bar-mode 0))
(menu-bar-mode 0)
(column-number-mode t)
(set-face-attribute 'default nil :height 140)
(setq-default
indent-tabs-mode nil
tab-width 4)
(setq recentf-save-file "~/.emacs.d/recentf")
(setq sentence-end-double-space nil)
(setq shell-command-switch "-lc")
;;; Configure Package.el And El-Get ;;;;
;;; Packages
(require 'package)
;; Setup package archives
(setq package-archives '(("org" . "http://orgmode.org/elpa/")
("MELPA" . "http://melpa.org/packages/")
("gnu" . "http://elpa.gnu.org/packages/")))
;; Load packages
(package-initialize)
;;; Setup Req-Package
(unless (require 'req-package nil t)
(package-refresh-contents)
(package-install 'req-package)
(require 'req-package))
(req-package--log-enable-logging)
(setq req-package-log-level 'debug)
(setq
init-pkgs-to-req
'(
;; (el-get
;; :defer t
;; :config (progn
;; (require 'el-get-custom)
;; (setq el-get-verbose t)
;; (let ((dir (file-name-directory el-get-status-file)))
;; (unless (file-exists-p dir)
;; (make-directory dir)))
;; ;; Sync El-Get Packages
;; (setq el-get-sources
;; '((:name cedet :lazy t)
;; (:name bbdb
;; :branch "bbdb_2.35"
;; :info nil
;; :features bbdb-autoloads
;; :build '("autoconf" "./configure" "make all"))))
;; (setq user/el-get-packages
;; (mapcar 'el-get-source-name el-get-sources))
;; (el-get 'sync user/el-get-packages)))
(bind-key
:config (progn
(unbind-key "C-z")
(bind-key "C-z B" 'browse-url)
(bind-key "C-g" 'keyboard-escape-quit)
(bind-key "<C-return>" 'newline-and-indent)
(bind-key "<mouse-3>" 'mouse-popup-menubar)
(bind-key "<mouse-8>" 'previous-buffer)
(bind-key "<mouse-9>" 'next-buffer)
(bind-key "C-x C-M-k" 'kill-matching-buffers)
(bind-key "C-h C-M-f" 'find-function)
(bind-key "C-h C-M-v" 'find-variable)
(bind-key "C-z C-\\" 'toggle-hiding)
(bind-key "C-z C--" 'toggle-selective-display)
(bind-key "C-z C-z" 'suspend-frame)
(bind-key "C-z M-w" 'clipboard-kill-ring-save)
(bind-key "C-z C-r" 'rename-buffer)
(bind-key "C-z e" 'eval-region)))
(benchmark-init
:config (benchmark-init/activate))
(auto-compile
:config (progn
(auto-compile-on-save-mode)
(auto-compile-on-load-mode)))))
(req-packages init-pkgs-to-req)
(req-package-finish)
(setq
pkgs-to-req
'((ace-jump-mode
:commands (ace-jump-char-mode
ace-jump-line-mode
ace-jump-word-mode)
:bind (("C-z j" . ace-jump-char-mode)
("C-z l" . ace-jump-line-mode)
("C-z w" . ace-jump-word-mode)))
(adaptive-wrap :defer t)
(aes :defer t)
(alpha
:defer t
:config (progn
(add-to-list 'default-frame-alist '(alpha . 100))))
;; (ansi-term-command
;; :config (progn
;; (defun user/ansi-term-sudo-shell ()
;; (interactive)
;; (ansi-term-command "sudo" "-i"))
;; (ansi-term-command-setup-atc-alias)))
(ascii :defer t)
(asm-mode
;; Make comments work better w/ fill-paragraph
:config (add-hook-progn 'asm-mode-hook
(set (make-local-variable 'paragraph-start)
"^\\s-*;+.*$")))
(async)
(async-bytecomp :require async)
;; (auctex
;; :defer t
;; :mode ("\\.tex\\'" . LaTeX-mode)
;; :config (progn
;; (require 'tex)
;; (require 'tex-site)
;; (require 'preview)
;; (add-hook 'LaTeX-mode-hook 'outline-minor-mode)))
(auctex-latexmk :defer t)
(auto-dim-other-buffers
:diminish auto-dim-other-buffers-mode
:config (auto-dim-other-buffers-mode))
(autorevert
:config (global-auto-revert-mode t))
(auto-compile)
(bash-completion
:config (bash-completion-setup))
(browse-kill-ring)
(charmap :defer t)
(cl-lib)
(color-theme)
(color-theme-sanityinc-tomorrow
:defer t
:require color-theme
:config (load-theme 'sanityinc-tomorrow-blue))
(cc-mode
:defer t
:config (progn
(setq c-default-style "K&R")
(setq c-basic-offset 4)
(setq tab-width 4)
(setq indent-tabs-mode nil)))
(company
:diminish company-mode
:config (progn
(global-company-mode t)
;; I HATE it when <return> selects the current
;; autocompletion candidate when I just want to start a
;; new line. Unbinding <return> means I can still use
;; <tab> for that purpose.
(unbind-key "RET" company-active-map)
(unbind-key "<return>" company-active-map)
(setq
;; Helm-company usually pukes if company autocompletion
;; starts after helm-company is called.
company-idle-delay 0
;; Get rid of company menu. I'll use helm.
company-frontends
(remove 'company-pseudo-tooltip-unless-just-one-frontend
company-frontends)
company-elisp-detect-function-context nil
company-backends '((company-gtags
;; company-etags
company-elisp
company-files
company-dabbrev
company-dabbrev-code
company-ropemacs)
;; company-bbdb
;; company-nxml
;; company-css
;; company-clang
;; company-cmake
company-dabbrev))))
(concurrent :defer t)
(crontab-mode :defer t)
(csv-mode
:defer t
:mode "\\.csv\'")
(ctable :defer t)
(dash)
(darktooth-theme :defer t)
(deferred :defer t)
(dired+ :defer t)
(dired-efap)
(dired-single)
(doc-view
:defer t
:mode ("\\.pdf\\'" . doc-view-mode)
:mode ("\\.ps\\'" . doc-view-mode)
:config (setq doc-view-continuous t))
(ebib
:defer t
:mode "\\.bib\\'")
(eldoc
:defer t
:init (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode))
(electric
:config (electric-indent-mode 1))
(elfeed
:config (progn
(bind-key "q" 'kill-this-buffer elfeed-search-mode-map)
(setq elfeed-sort-order 'ascending)
(setq-default elfeed-search-filter "@2-weeks-ago +unread +daily ")))
(elfeed-org
:config (elfeed-org))
(erc
:defer t
:bind ("C-z c j" . erc-track-switch-buffer)
:init (defalias 'irc 'erc-tls)
:config (progn
(setq
erc-port 6697
erc-prompt-for-password t
erc-mode-line-format "%t %a"
erc-kill-queries-on-quit t
erc-kill-buffer-on-part t
erc-enable-logging t
erc-log-write-after-insert t
erc-log-write-after-send t
erc-log-channels-directory (concat "~/org/chats/" system-name "-irc/")
erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"))
(add-to-list 'erc-modules 'hl-nicks)
(add-to-list 'erc-modules 'notifications)
(add-to-list 'erc-modules 'track)
(add-to-list 'erc-modules 'log)
(add-to-list 'erc-modules 'spelling)))
(erc-hl-nicks
:defer t)
(erlang-mod
:defer t
:mode "\\.erl\\'"
:config (progn
(setq
erlang-root-dir "/usr/lib/erlang"
exec-path (cons "/usr/lib/erlang/bin" exec-path))))
(eshell
:defer t
;; :idle (require 'eshell)
:bind ("C-z s" . eshell)
:config (progn
(setq eshell-cmpl-cycle-completions t)
(add-hook-progn
'eshell-mode-hook
(evil-local-mode -1)
(company-mode -1)
(bind-key "TAB" 'helm-esh-pcomplete eshell-mode-map)
(bind-key "<tab>" 'helm-esh-pcomplete eshell-mode-map))))
(ess
:defer t
:commands julia
:config (progn
(require 'ess-site)
(setq
ess-directory "~/.ess/"
ess-ask-for-ess-directory nil)))
(evil
:demand t
:bind ("TAB" . evil-indent)
:init (setq evil-toggle-key "C-`")
:config (progn
(evil-mode 1)
(unbind-key "q" evil-normal-state-map)
(unbind-key "C-e" evil-insert-state-map)
(unbind-key "C-d" evil-insert-state-map)
(unbind-key "C-k" evil-insert-state-map)
(bind-key "C-g" 'evil-normal-state evil-insert-state-map)
(bind-key "C-c" 'evil-normal-state evil-visual-state-map)
(unbind-key "C-e" evil-motion-state-map)
(bind-key "C-c" 'evil-exit-visual-state evil-visual-state-map)
(unbind-key "M-." evil-normal-state-map)
;; For gtags
(unbind-key "M-." evil-visual-state-map)
(unbind-key "C-y" evil-motion-state-map)
;; For helm
(unbind-key "C-y" evil-insert-state-map)
(set-default 'evil-symbol-word-search t)
(add-hook-progn 'git-commit-mode-hook (evil-insert-state))
(setq evil-emacs-state-modes (append '(term-mode
elfeed-search-mode
elfeed-show-mode
epa-key-list-mode
git-rebase-mode
magit-popup-mode
magit-blame-mode
magit-key-mode
magit-status-mode)
evil-emacs-state-modes)
evil-insert-state-modes (append '(org-capture-mode
global-git-commit-mode
git-commit-mode
inferior-ess-mode)
evil-insert-state-modes)
evil-move-cursor-back nil
evil-want-C-i-jump nil)))
(evil-matchit
:demand t
:require evil
:config (turn-on-evil-matchit-mode))
(evil-leader
:demand t
:require evil)
(evil-nerd-commenter
:demand t
:require evil)
(evil-rsi
:require evil
:diminish evil-rsi-mode
:init (evil-rsi-mode))
(evil-surround
:demand t
:require evil
:config (global-evil-surround-mode 1))
(expand-region
:bind ("C-=" . er/expand-region))
(f :defer t)
(flycheck
:config (global-flycheck-mode 1))
(flycheck-rust
:defer t
:require (rust-mode flycheck)
:init (add-hook 'rust-mode-hook 'flycheck-rust-setup))
(flylisp
:defer t
:commands flylisp-mode
:init (progn
(defun enable-flylisp-mode ( )
(interactive)
(flylisp-mode 1))
(add-hook 'emacs-lisp-mode-hook 'enable-flylisp-mode)
(add-hook 'lisp-mode-hook 'enable-flylisp-mode)))
(flyspell
:diminish flyspell-mode
:commands (flyspell-mode flyspell-prog-mode)
:init (progn
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)))
(function-args :defer t)
(furl :defer t)
(ghc :defer t) ;?????
(git-blame :defer t)
(git-commit
:demand t
:config (global-git-commit-mode))
;; (git-modeline
;; :config (setq git-state-modeline-decoration 'git-state-decoration-letter))
(git-rebase :defer t)
(gitconfig-mode :defer t)
(gitignore-mode :defer t)
(ggtags
:bind ("M-r" . ggtags-query-replace))
(julia-mode
:defer t
:commands julia-mode
:mode "\\.jl\\'")
(haskell-mode
:defer t
:mode "\\.hs\\'"
:init (progn
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)))
(helm
:diminish helm-mode
:bind (("C-x d" . helm-find-files)
("M-x" . helm-M-x)
("C-y" . helm-show-kill-ring)
("C-x b" . helm-mini)
("C-x C-b" . helm-mini)
("C-x C-f" . helm-find-files)
("C-h a" . helm-apropos)
("C-z <C-SPC>" . helm-mark-ring)
("C-z <C-SPC>" . helm-global-mark-ring)
("C-z r" . helm-regexp))
:init (setq helm-command-prefix-key "C-z h")
:config (progn
(require 'helm-config)
(helm-mode 1)
;; Swap Tab and C-z in helm-mode, so Tab executes
;; persistent actions, and C-z opens the actions
;; menu.
(bind-key "<tab>" 'helm-execute-persistent-action helm-map)
(bind-key "<C-tab>" 'helm-select-action helm-map)
(bind-key "g" 'helm-google-suggest helm-command-map)
(bind-key "o" 'helm-occur helm-command-map)
(bind-key "x" 'helm-register helm-command-map)
(setq
helm-google-suggest-use-curl-p t)))
(helm-company
:require (helm company)
:bind ("<C-tab>" . helm-company))
(helm-gtags
:demand t
:require (helm ggtags)
:init (progn
(defun helm-gtags-update-tags-quietly ()
(flet ((message (&rest _) nil))
(helm-gtags-update-tags)))
(define-minor-mode helm-gtags-auto-update-mode
"Auto update GTAGS when a file in this mode is saved."
:init-value nil
:group 'helm-gtags-update
(if helm-gtags-auto-update-mode
(progn
(add-hook 'after-save-hook 'helm-gtags-update-tags-quietly nil :local))
(remove-hook 'after-save-hook 'helm-gtags-update-tags-quietly t)))
(defun enable-helm-gtags-auto-update-mode()
"Turn on `helm-gtags-auto-update-mode'."
(interactive)
(helm-gtags-auto-update-mode 1))
(add-hook 'dired-mode-hook 'helm-gtags-mode)
(add-hook 'prog-mode-hook 'helm-gtags-mode)
(add-hook 'prog-mode-hook 'enable-helm-gtags-auto-update-mode))
:config (progn
(require 'ggtags)
(setq
helm-gtags-ignore-case t
helm-gtags-auto-update t
helm-gtags-use-input-at-cursor t
helm-gtags-pulse-at-cursor t
helm-gtags-suggested-key-mapping t)
(bind-key "M-." 'helm-gtags-find-tag helm-gtags-mode-map)
(bind-key "M-?" 'helm-gtags-find-pattern helm-gtags-mode-map)))
(helm-package :require helm)
(helm-projectile
:demand t
:bind ("s-%" . projectile-replace)
:init (setq projectile-keymap-prefix (kbd "C-z p"))
:config (progn
(projectile-global-mode 1)
(helm-projectile-on)
(defadvice helm-projectile-find-file
(before dont-use-cache-for-current-project disable)
(projectile-invalidate-cache nil))
(setq
projectile-find-file-hook (lambda () (projectile-invalidate-cache nil))
projectile-enable-caching t
projectile-completion-system 'helm
projectile-find-dir-includes-top-level t
projectile-switch-project-action 'projectile-vc)
(if (eq system-type 'cygwin)
(setq projectile-switch-project-action 'projectile-dired))
;; Rebind this, because the helm version doesn't work
;; outside of project dirs.
(bind-key "C-z p F" 'projectile-find-file-in-known-projects projectile-mode-map)))
(helm-swoop
:bind ("C-z o" . helm-swoop)
;; I don't want swoop to auto-insert the symbol under my cursor.
:init (setq helm-swoop-pre-input-function (lambda ())))
(helm-unicode)
(inline-crypt
:commands (inline-crypt-decrypt-region
inline-crypt-decrypt-string
inline-crypt-encrypt-region
inline-crypt-encrypt-string)
:bind (("C-z C-c C-d" . inline-crypt-decrypt-region)
("C-z C-c C-e" . inline-crypt-encrypt-region)
("C-z C-c d" . inline-crypt-decrypt-string)
("C-z C-c e" . inline-crypt-encrypt-string)))
(js2-mode
:defer t
:mode "\\.js\\'")
(json-mode
:defer t
:require json-reformat
:mode "\\.json\\'")
(json-reformat :defer t)
(list-packages-ext :defer t)
(list-processes+)
(list-utils)
(log4e :defer t)
(magit
:defer t
:commands (magit-blame-mode magit-status)
:bind (("C-z v" . magit-status)
("C-z m a" . magit-commit-amend)
("C-z m b" . magit-blame-mode))
:init (setq
magit-status-buffer-switch-function 'switch-to-buffer
magit-last-seen-setup-instructions "1.4.0"))
(markdown-mode
:defer t
:mode "\\.md\\'"
:require electric
:config (progn
(require 'markdown-mode+)
(setq markdown-enable-math t) ; LaTeX math
;; Electric-indent buggers indentation up in markdown-mode
(add-hook 'electric-indent-functions
(lambda (_unused) 'no-indent) nil 'local)))
(markdown-mode+
:defer t
:require markdown-mode)
;; (marmalade)
(notmuch :defer t)
(notmuch-labeler :defer t)
(nxml
:defer t
:mode "\\.xml'"
:config (setq nxml-child-indent 2))
(org
:defer t
:mode ("\\.\\(org\\|org_archive\\)\\'" . org-mode)
:commands (org-agenda org-iswitchb)
:bind (("C-z C-o ]" . outline-next-heading)
("C-z C-o [" . outline-previous-heading)
("C-z C-o a" . org-agenda)
("C-z C-o b" . user/org-iswitchb-agenda)
("C-z C-o j" . org-clock-goto)
("C-z C-o l" . org-store-link)
("C-z C-o o" . org-clock-out)
("C-z C-o <C-right>" . org-demote-subtree)
("C-z C-o <C-left>" . org-promote-subtree))
;; :idle (require 'org)
:init (defun user/org-iswitchb-agenda ()
"call `org-iswitchb' with two prefix args, restricting selection
to agenda files."
(interactive)
(org-iswitchb 14))
:config (progn
;; (require 'org-journal)
;; (require 'org-toc)
(add-hook-progn 'org-mode-hook (flycheck-mode -1))
;; For `helm-show-kill-ring'
(unbind-key "C-y" org-mode-map)
;; Default binding for <C-tab> is dumb. I want
;; `helm-company', dammit!
(unbind-key "<C-tab>" org-mode-map)
(bind-key "<C-M-tab>" 'org-force-cycle-archived org-mode-map)
;; Make "C-z C-o a <RET>" display an overview of all
;; tasks in my agenda files.
(setq
org-agenda-custom-commands
'(("" "Agenda Tasks"
((agenda "" ((org-agenda-overriding-header "== Agenda ==")))
(tags-todo "/+WIP" ((org-agenda-overriding-header "Tasks In Progress")
(org-agenda-todo-ignore-deadlines t)
(org-tags-match-list-sublevels t)))
(tags-todo "-meta/NEXT" ((org-agenda-overriding-header "Next Tasks")
(org-tags-match-list-sublevels t)))
(tags-todo "/+OnHOLD" ((org-agenda-overriding-header "Tasks On Hold")))
(tags-todo "/+TODO" ((org-agenda-overriding-header "Tasks")
(org-agenda-skip-function '(org-agenda-skip-entry-if
'scheduled 'deadline))))
(tags-todo "/FUTURE" ((org-agenda-overriding-header "Future Tasks")
(org-agenda-todo-ignore-scheduled t)
(org-agenda-todo-ignore-deadlines t)))
(tags "+REFILE/" ((org-agenda-overriding-header "Tasks to Refile")
(org-tags-match-list-sublevels nil)))
(tags "-archived-event/DONE|CANCELLED" ((org-agenda-overriding-header "Tasks to Archive"))))
nil)))
(setq
;; Render special formatting in buffer
org-pretty-entities t
org-pretty-entities-include-sub-superscripts t
org-columns-default-format (concat "%45ITEM "
"%TODO "
"%3PRIORITY "
"%6Effort(Effort){:} "
"%6CLOCKSUM(Time){:}")
;; Org Capture
org-default-notes-file "~/personal/refile.org"
org-cycle-separator-lines 2
;; Org Journal
org-journal-dir "~/org/journal/"
;; Org Agenda
org-agenda-start-on-weekday nil
org-agenda-start-with-clockreport-mode nil
org-agenda-start-with-log-mode t
org-agenda-skip-additional-timestamps-same-entry t
org-agenda-dim-blocked-tasks nil
org-agenda-overriding-columns-format (concat "%CATEGORY "
"%45ITEM "
"%TODO "
"%3PRIORITY "
"%6Effort(Effort){:} "
"%6CLOCKSUM(Time){:}")
org-agenda-remove-tags 'prefix
org-agenda-sorting-strategy '((agenda time-up priority-down habit-down category-up)
(todo priority-down category-up todo-state-up)
(tags priority-down category-up todo-state-up)
(search priority-down category-up todo-state-up))
org-agenda-window-setup 'same-window
;; When prompting for an org-mode path, construct the path
;; incrementally.
org-outline-path-complete-in-steps nil
org-refile-use-outline-path 'file
;; When refiling to a parent node that doesn't exist, prompt to
;; create it.
org-refile-allow-creating-parent-nodes 'confirm
org-completion-use-ido t
ido-everywhere t
ido-max-directory-size 100000
;; Tags
;; Don't make children inherit "prj" tag from parent items
org-tags-exclude-from-inheritance '("prj")
;; State Workflow
org-todo-keywords '(;; Work Statuses
(sequence "FUTURE(f)"
"OnHOLD(h@/!)"
"TODO(t@)"
"NEXT(n@)"
"WIP(w@)"
"|"
"DONE(d@)")
;; Extraordinary Statuses
(sequence "|" "CANCELLED(c@)"))
;; Export
org-latex-pdf-process '("latexmk -bibtex -pdf %f && latexmk --bibtex -c")
org-export-creator-info nil
org-export-with-sub-superscripts t
;; When exporting to ODT, convert it to a PDF, too
org-export-odt-preferred-output-format "pdf"
;; Remove logfiles after exporting a PDF
org-export-pdf-remove-logfiles t
;; Time/Clocking
;; Don't prompt for a note when clocking out
org-log-note-clock-out nil
org-clock-clocktable-default-properties '(:maxlevel 4 :scope file)
;; Don't always default to dates in the future
org-read-date-prefer-future nil
org-clock-out-remove-zero-time-clocks t
org-clock-persist t
;; Do not prompt to resume an active clock
org-clock-persist-query-resume nil
;; Include current clock task in clock reports
org-clock-report-include-clocking-task t
org-edit-timestamp-down-means-later nil
org-log-done 'time
org-log-into-drawer t
org-time-clocksum-format (list :hours "%d"
:require-hours t
:minutes ":%02d"
:require-minutes t))))
(org-capture
:defer t
:bind ("C-z C-o C-c" . org-capture))
(org-projectile :defer t)
;; (org-journal
;; :defer t
;; :require org)
;; (org-toc
;; :defer t
;; :require org)
(outline-magic)
(outline-mode
:defer t
:config (progn
(bind-key "<C-down>" 'outline-next-visible-heading outline-minor-mode-map)
(bind-key "<C-up>" 'outline-previous-visible-heading outline-minor-mode-map)
(bind-key "<M-down>" 'outline-move-subtree-down outline-minor-mode-map)
(bind-key "<M-up>" 'outline-move-subtree-up outline-minor-mode-map)
(bind-key "<M-left>" 'outline-promote outline-minor-mode-map)
(bind-key "<M-right>" 'outline-demote outline-minor-mode-map)
(bind-key "<C-M-tab>" 'outline-cycle outline-minor-mode-map)))
(package+)
(paren
:config (show-paren-mode t))
(persistent-soft)
(pg :defer t)
(pkg-info)
(popup :defer t)
(pyflakes :defer t)
(pylint
:defer t
:commands pylint
:config (progn
(setq
pylint-command "pylint"
pylint-options '("-E" "--reports=n" "--output-format=parseable"))))
(python
:defer t
:commands python-mode
:mode ("\\.py\\'" . python-mode))
(python-pep8 :defer t)
(regex-dsl)
(request :defer t)
(rust-mode
:defer t
:mode "\\.rs\\'")
(s)
(scala-mode
:defer t
:mode "\\.scala\\'"
:config (scala-mode-feature-electric-mode))
(scala-mode2 :defer t)
;; (shell-command :type elpa)
(slime
:defer t
:require slime-company
:commands slime
:init (setq inferior-lisp-program "/usr/bin/sbcl")
:config (progn
(slime-setup (cons 'slime-company slime-contribs))
;; Key bindings
(bind-key "RET" 'newline-and-indent slime-mode-map)))
(slime-company
:defer t)
(ssh-config-mode :defer t)
(term
:bind ("C-z t" . user/ansi-term)
:init (progn
(defun user/ansi-term ()
(interactive)
(ansi-term "/bin/bash" "shell"))
(defun user/term-send-prev-word ()
(interactive)
(term-send-raw-string "\eb"))
(defun user/term-send-next-word ()
(interactive)
(term-send-raw-string "\ef")))
:config (progn
(bind-key "C-z" 'term-stop-subjob term-raw-escape-map)
(bind-key "<C-left>" 'user/term-send-prev-word term-raw-map)
(bind-key "<C-right>" 'user/term-send-next-word term-raw-map)
(add-hook-progn 'term-mode-hook (evil-local-mode -1))
;; TODO: make a term-exit-hook instead
(defadvice term-handle-exit
(after bind-q-to-kill-dead-term activate)
(read-only-mode)
(local-set-key (kbd "q") 'kill-buffer-and-window))
;; Terminals in emacs should be able to run tmux, regardless of
;; whether or not emacs was started within tmux.
(setenv "TMUX" "")))
(term-run
:bind (("M-!" . term-run-shell-command)
("C-M-!" . shell-command)))
(tidy
:defer t
:commands tidy-buffer
;; Tell the tidy command to tidy up XML files; by default,
;; it complains about XML being "malformed HTML".
:config (setq tidy-shell-command "/usr/bin/tidy -xml"))
(tramp
;; Theoretically, make TRAMP handle /sudo:root@host: paths by logging
;; in via the regular TRAMP ssh method, and then `sudo` to root.
:config (setq tramp-default-proxies-alist '(((regexp-quote (system-name)) nil nil)
(nil "\\`root\\'" "/ssh:%h:"))))
(tron-theme
:defer t
:require color-theme
:config (load-theme 'tron-theme t))
(tronesque-theme
:defer t
:require color-theme
:config (load-theme 'tronesque t))
(ucs-utils :defer t)
(undo-tree
:diminish undo-tree-mode
:config (global-undo-tree-mode 1))
(unfill)
(unicode-fonts
:require persistent-soft
:init
(defun my-hook-unicode-fonts-setup (frame)
"Run unicode-fonts-setup, then remove the hook."
(progn
(select-frame frame)
(unicode-fonts-setup)
(message "Removing unicode-fonts-setup to after-make-frame-functions hook")
(remove-hook 'after-make-frame-functions 'my-hook-unicode-fonts-setup)))
;(add-hook 'after-make-frame-functions 'my-hook-unicode-fonts-setup nil)
:config
(require 'persistent-soft))
(unicode-whitespace)
(vc
:config (setq vc-follow-symlinks t))
(wc-mode :defer t)
(web-beautify :defer t)
(web-mode
:defer t
:mode "\\.\\(p?html?\\|tpl\\|php\\|jsp\\|as[cp]x\\|erb\\)\\'"
:config (setq web-mode-disable-auto-pairing nil))
(window-jump
:bind (("C-z <C-down>" . window-jump-down)
("C-z <down>" . window-jump-down)
("C-z <C-up>" . window-jump-up)
("C-z <up>" . window-jump-up)
("C-z <C-left>" . window-jump-left)
("C-z <left>" . window-jump-left)
("C-z <C-right>" . window-jump-right)
("C-z <right>" . window-jump-right)))
(wrap-region)
(ws-butler
:diminish (ws-butler-mode)
;; ws-butler breaks emacs if it's run before the emacs window
;; starts.
:init (add-hook 'window-setup-hook 'ws-butler-global-mode))
(xclip)
(xt-mouse
:if (not window-system)
:defer t
:init (xterm-mouse-mode t))
(yasnippet :defer t)
(zenburn-theme
:require color-theme
:config (progn
(load-theme 'zenburn t)
(set-face-background 'region "dark slate gray")))))
(req-packages pkgs-to-req)
(req-package-finish)
;;; For Time Sheets
(defun tbl-total-hours-to-money(wage original-string)
(let* ((without-asterisks (replace-regexp-in-string
"\*" "" original-string))
(hours (destructuring-bind (hours-str minutes-str)
(split-string without-asterisks ":")
(+ (string-to-number hours-str)
(/ (string-to-number minutes-str) 60.0)))))
(format "$%.2d" (* hours wage))))
;; I want to start with an ielm buffer open
(save-window-excursion
(ielm))
;;; Load Private Emacs Config
(when (file-exists-p "~/personal/personal.el")
(load "~/personal/personal.el"))