aboutsummaryrefslogtreecommitdiff
path: root/.emacs
blob: 52f28986318bc9537658a4187b2b9384f926fd25 (plain)
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
;;; Indent
(setq-default indent-tabs-mode nil)

;;; GUI
(scroll-bar-mode 0)
(tool-bar-mode -1)
;; (add-to-list 'default-frame-alist '(tool-bar-position . left))
(setq ring-bell-function 'ignore)
(menu-bar-mode -1)

(tab-bar-mode -1)

;;; helm
(global-set-key (kbd "M-x") 'helm-M-x)
(helm-mode t)

;;; Projectile
(projectile-mode +1)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)

;;; Org
(setq org-directory "~/org")
(setq org-agenda-files (list org-directory))
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c c") 'org-capture)
(setq org-default-notes-file (concat org-directory "/notes.org"))
(add-hook 'org-mode-hook
          (lambda ()
            (set-face-attribute 'org-document-title nil :height 1.4)
            (set-face-attribute 'org-level-1 nil :height 1.3)
            (set-face-attribute 'org-level-2 nil :height 1.2)
            (set-face-attribute 'org-level-3 nil :height 1.1)))
(setq org-capture-templates '(("c" "Note" entry (file+headline "" "Notes")
                               "* %?\n  :PROPERTIES:\n  :CREATED: %U\n  :END:\n  %u\n  %a"
                               :empty-lines 1)
                              ("l" "Log" entry (file "~/org/log.org")
                               "* %?\n  :PROPERTIES:\n  :CREATED: %U\n  :END:\n"
                               :empty-lines 1)
                              ("t" "Tasks" entry (file+headline "" "Tasks")
                               "* TODO %?\n  :PROPERTIES:\n  :CREATED: %U\n  :END:\n  %a"
                               :empty-lines 1)))
(setq org-todo-keywords
      '((sequence "TODO(t)" "WAIT(w)" "|" "DONE(d)" "SOMEDAY(s)" "CANCELED(c)")))
(org-babel-do-load-languages
 'org-babel-load-languages
 '((shell . t)
   (emacs-lisp . t)
   (scheme . t)
   (eshell . t)))
(setq org-confirm-babel-evaluate nil)

;;; org-bullets
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))

;;; SKK
(setq default-input-method "japanese-skk")
(setq skk-large-jisyo "~/.emacs.d/skk-get-jisyo/SKK-JISYO.L")

;;; Theme
(when (display-graphic-p)
  (load-theme 'doom-dracula t))

;;; modeline
(doom-modeline-init)
(setq doom-modeline-project-detection 'projectile)
(setq doom-modeline-buffer-file-name-style 'auto)
(setq doom-modeline-gnus t)
(setq doom-modeline-gnus-timer 2)
(display-battery-mode 1)
(display-time-mode 1)
(setq display-time-default-load-average t)
(column-number-mode t)

;;; undo-tree-mode
(global-undo-tree-mode t)

;;; which-key
(which-key-mode)

;;; Font
(when (display-graphic-p)
  (set-face-attribute 'default nil :family "Hermit"  :height 100)
  (set-fontset-font (frame-parameter nil 'font)
                    'japanese-jisx0208
                    (font-spec :family "Noto Sans Mono CJK JP"
                               :size 16)))

;;; Paredit
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
(add-hook 'emacs-lisp-mode-hook       #'enable-paredit-mode)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
(add-hook 'ielm-mode-hook             #'enable-paredit-mode)
(add-hook 'lisp-mode-hook             #'enable-paredit-mode)
(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
(add-hook 'scheme-mode-hook           #'enable-paredit-mode)

;;; Lisp
(add-hook 'lisp-mode-hook
	  (lambda ()
	    (set (make-local-variable 'lisp-indent-function)
		 'common-lisp-indent-function)))

;;; Guix
(when (file-directory-p "~/src/guix")
  ;; (with-eval-after-load 'geiser-guile
  ;;   (add-to-list 'geiser-guile-load-path "~/src/guix"))
  (with-eval-after-load 'yasnippet
    (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
  (setq user-full-name "Masaya Tojo")
  (setq user-mail-address "masaya@tojo.tokyo")
  (load-file "~/src/guix/etc/copyright.el")
  (setq copyright-names-regexp
        (format "%s <%s>" user-full-name user-mail-address))
  (add-hook 'after-save-hook 'copyright-update))

;;; ACL2
(when (file-directory-p "~/acl2-8.3")
  (load "~/acl2-8.3/emacs/emacs-acl2.el")
  (put 'defthm 'lisp-indent-function 1))

;;; Geiser
(setq geiser-active-implementations '(guile))

;;; browse-at-remote
(global-set-key (kbd "C-c g g") 'browse-at-remote)

;;; w3m
(setq w3m-search-default-engine "Weblio")
(setq w3m-search-engine-alist '(("Weblio" "https://ejje.weblio.jp/content/%s")))
(global-set-key (kbd "C-c w") 'w3m-search)

(defun set-alpha (alpha-num)
  (interactive "nAlpha: ")
  (set-frame-parameter nil 'alpha (cons alpha-num (min 100 (+ 10 alpha-num)))))
(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
   ["#282a36" "#ff5555" "#50fa7b" "#f1fa8c" "#61bfff" "#ff79c6" "#8be9fd" "#f8f8f2"])
 '(custom-safe-themes
   '("57bd93e7dc5fbb5d8d27697185b753f8563fe0db5db245592bab55a8680fdd8c" default))
 '(fci-rule-color "#6272a4")
 '(jdee-db-active-breakpoint-face-colors (cons "#1E2029" "#bd93f9"))
 '(jdee-db-requested-breakpoint-face-colors (cons "#1E2029" "#50fa7b"))
 '(jdee-db-spec-breakpoint-face-colors (cons "#1E2029" "#565761"))
 '(objed-cursor-color "#ff5555")
 '(pdf-view-midnight-colors (cons "#f8f8f2" "#282a36"))
 '(rustic-ansi-faces
   ["#282a36" "#ff5555" "#50fa7b" "#f1fa8c" "#61bfff" "#ff79c6" "#8be9fd" "#f8f8f2"])
 '(vc-annotate-background "#282a36")
 '(vc-annotate-color-map
   (list
    (cons 20 "#50fa7b")
    (cons 40 "#85fa80")
    (cons 60 "#bbf986")
    (cons 80 "#f1fa8c")
    (cons 100 "#f5e381")
    (cons 120 "#face76")
    (cons 140 "#ffb86c")
    (cons 160 "#ffa38a")
    (cons 180 "#ff8ea8")
    (cons 200 "#ff79c6")
    (cons 220 "#ff6da0")
    (cons 240 "#ff617a")
    (cons 260 "#ff5555")
    (cons 280 "#d45558")
    (cons 300 "#aa565a")
    (cons 320 "#80565d")
    (cons 340 "#6272a4")
    (cons 360 "#6272a4")))
 '(vc-annotate-very-old-color nil))
(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.
 )