Configurations for GNU Emacs

Table of Contents

1. はじめに

1.1. 基本情報

2. Header

;; init.el --- My init.el
;; Configurations for Emacs
;;                                         Takeo Obara  <bararararatty@gmail.com>

3. Boot

3.1. env

(defconst my/loading-profile-p nil
  "If non-nil, use built-in profiler.el.")

(defconst my/enable-profile nil
  "If true, enable profile")

3.2. profile

(when my/enable-profile
  (require 'profiler)
  (profiler-start 'cpu))

3.3. Magic File Name を一時的に無効にする

(defconst my/saved-file-name-handler-alist file-name-handler-alist)
(setq file-name-handler-alist nil)

3.4. 起動時間計測

(defconst my/before-load-init-time (current-time))

;;;###autoload
(defun my/load-init-time ()
  "Loading time of user init files including time for `after-init-hook'."
  (let ((time1 (float-time
                (time-subtract after-init-time my/before-load-init-time)))
        (time2 (float-time
                (time-subtract (current-time) my/before-load-init-time))))
    (message (concat "Loading init files: %.0f [msec], "
                     "of which %.f [msec] for `after-init-hook'.")
             (* 1000 time1) (* 1000 (- time2 time1)))))
(add-hook 'after-init-hook #'my/load-init-time t)

(defvar my/tick-previous-time my/before-load-init-time)

;;;###autoload
(defun my/tick-init-time (msg)
  "Tick boot sequence at loading MSG."
  (when my/loading-profile-p
    (let ((ctime (current-time)))
      (message "---- %5.2f[ms] %s"
               (* 1000 (float-time
                        (time-subtract ctime my/tick-previous-time)))
               msg)
      (setq my/tick-previous-time ctime))))

(defun my/emacs-init-time ()
  "Emacs booting time in msec."
  (interactive)
  (message "Emacs booting time: %.0f [msec] = `emacs-init-time'."
           (* 1000
              (float-time (time-subtract
                           after-init-time
                           before-init-time)))))

(add-hook 'after-init-hook #'my/emacs-init-time)

3.5. async load

(defvar my/delayed-priority-high-configurations '())
(defvar my/delayed-priority-high-configuration-timer nil)

(defvar my/delayed-priority-low-configurations '())
(defvar my/delayed-priority-low-configuration-timer nil)

(add-hook 'emacs-startup-hook
          (lambda ()
            (setq my/delayed-priority-high-configuration-timer
                  (run-with-timer
                   0.1 0.0001
                   (lambda ()
                     (if my/delayed-priority-high-configurations
                         (let ((inhibit-message t))
                           (eval (pop my/delayed-priority-high-configurations)))
                       (progn
                         (cancel-timer my/delayed-priority-high-configuration-timer))))))
            (setq my/delayed-priority-low-configuration-timer
                  (run-with-timer
                   0.2 0.001
                   (lambda ()
                     (if my/delayed-priority-low-configurations
                         (let ((inhibit-message t))
                           (eval (pop my/delayed-priority-low-configurations)))
                       (progn
                         (cancel-timer my/delayed-priority-low-configuration-timer))))))))

(defmacro with-delayed-execution-priority-high (&rest body)
  (declare (indent 0))
  `(setq my/delayed-priority-high-configurations
         (append my/delayed-priority-high-configurations ',body)))

(defmacro with-delayed-execution (&rest body)
  (declare (indent 0))
  `(setq my/delayed-priority-low-configurations
         (append my/delayed-priority-low-configurations ',body)))

3.6. autoload-if-found

;;;###autoload
(defun autoload-if-found (functions file &optional docstring interactive type)
  "set autoload iff. FILE has found."
  (when (locate-library file)
    (dolist (f functions)
      (autoload f file docstring interactive type))
    t))

3.7. el-get

(eval-when-compile
  (add-to-list 'load-path (locate-user-emacs-file "el-get/el-get"))
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

(with-delayed-execution
  (message "Install el-get...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/el-get"))
  (require 'el-get)
  (with-eval-after-load 'el-get
    (eval-and-compile
      (setq el-get-git-shallow-clone t
            el-get-verbose nil
            el-get-silent-update t
            el-get-default-process-sync t))))

4. Basic

4.1. 末尾のスペースを可視化する

(with-delayed-execution
  (dolist
      (mode '(comint-mode
              eshell-mode
              eww-mode
              term-mode
              twittering-mode
              minibuffer-inactive-mode
              dashboard-mode
              fundamental-mode))

    (add-hook (intern (concat (symbol-name mode) "-hook"))
              #'(lambda () (setq show-trailing-whitespace nil)))))

4.2. 行番号を表示する

(with-delayed-execution
  (with-eval-after-load 'linum
    (eval-and-compile
      (setq linum-delay t)))
  (defadvice linum-schedule (around my-linum-schedule () activate)
    (run-with-idle-timer 1 nil #'linum-update-current))
  (global-linum-mode t))

4.3. C-kで行削除

(with-eval-after-load 'simple
  (setq kill-whole-line t))

4.4. カッコの中をハイライトする

(with-delayed-execution
  (show-paren-mode t)

  (with-eval-after-load 'paren
    (setq-default show-paren-style 'mixed)))

4.5. カッコが自動的に作られるようにする

(with-delayed-execution
  (electric-pair-mode 1))

4.6. coding system

(with-delayed-execution-priority-high
  ;; language and locale
  (set-language-environment "Japanese")
  (setq system-time-locale "C")

  ;; coding system
  (set-default-coding-systems 'utf-8-unix)
  (prefer-coding-system 'utf-8-unix)
  (set-selection-coding-system 'utf-8-unix)

  ;; prefer-coding-system take effect equally to follows
  (set-buffer-file-coding-system 'utf-8-unix)
  (set-file-name-coding-system 'utf-8-unix)
  (set-terminal-coding-system 'utf-8-unix)
  (set-keyboard-coding-system 'utf-8-unix)
  (setq locale-coding-system 'utf-8-unix))

4.7. global-auto-revert-mode

(with-delayed-execution
  (global-auto-revert-mode t))

4.8. yes/no to y/n

(with-delayed-execution-priority-high
  (fset 'yes-or-no-p 'y-or-n-p))

4.9. dired-use-ls-dired

(with-eval-after-load 'dired-load-hook
  (when (string= system-type "darwin")
    (setq dired-use-ls-dired nil)))

4.10. keybind

(keyboard-translate ?\C-h ?\C-?)

(global-set-key (kbd "M-¥") #'(lambda () (interactive) (insert "\\")))
(global-set-key (kbd "C-h") 'c-hungry-delete-backwards)
(global-set-key (kbd "C-d") 'c-hungry-delete-forward)
(global-set-key (kbd "M-h") 'backward-kill-words)
(global-set-key (kbd "C-z") 'undo)
(global-set-key (kbd "C-?") 'help-command)
(global-set-key (kbd "C-a") 'back-to-indentation)
(global-set-key (kbd "C-c i") 'find-function)
(global-set-key (kbd "C-x C-o") 'other-window)

(global-set-key (kbd "C-x l") 'next-buffer)
(global-set-key (kbd "C-x h") 'previous-buffer)

(global-set-key (kbd "C-x C-k") nil)
(global-set-key (kbd "C-x C-n") nil)

(when window-system
  (global-set-key (kbd "C-x C-c") nil))

4.11. common lispを使う

(eval-when-compile
  (setq byte-compile-warnings '(cl-functions))
  (require 'cl-lib nil t))

(with-delayed-execution-priority-high
  (message "install cl-lib....")
  (require 'cl-lib))

4.12. savehistを有効にする

(with-delayed-execution-priority-high 'savehist
  (savehist-mode 1))

4.13. [mac] clipboardに入るようにする

(eval-and-compile
  (defun my/copy-from-osx ()
    (shell-command-to-string "pbpaste"))

  (defun my/paste-to-osx (text)
    (let ((process-connection-type nil))
      (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
        (process-send-string proc text)
        (process-send-eof proc))))

  (when (and (string= system-type "darwin")
             (not window-system))
    (setq interprogram-cut-function 'my/paste-to-osx)
    (setq interprogram-paste-function 'my/copy-from-osx)))

4.14. pluginをnative compする

(with-eval-after-load 'comp
  (defun my/native-comp-packages ()
    (interactive)
    (let ((native-comp-async-jobs-number 8)
          (native-comp-speed 3))
      (native-compile-async "~/.emacs.d/init.el")
      (native-compile-async "~/.emacs.d/early-init.el")
      (native-compile-async "~/.emacs.d/el-get" 'recursively)
      (native-compile-async "~/.emacs.d/elpa" 'recursively))))

4.15. native compを無効にする

(with-eval-after-load 'comp
  (eval-and-compile
    (setq package-native-compile nil)))

4.16. native compのwarningを抑える

(custom-set-variables '(warning-suppress-types '((comp))))

4.17. 同一bufferの名前を変える

(with-eval-after-load 'uniquify
  (eval-and-compile
    (setq uniquify-buffer-name-style 'post-forward-angle-brackets)))

5. Utility

5.1. dash

(eval-when-compile
  (el-get-bundle 'dash))

(with-delayed-execution-priority-high
  (message "Install dash...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/dash"))))

5.2. mustache

(eval-when-compile
  (el-get-bundle 'mustache))

(with-delayed-execution-priority-high
  (message "Install mustache...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/mustache"))))

5.3. f

(eval-when-compile
  (el-get-bundle 'f))

(with-delayed-execution-priority-high
  (message "Install f...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/f"))))

5.4. s

(eval-when-compile
  (el-get-bundle 's))

(with-delayed-execution-priority-high
  (message "Install s...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/s"))))

5.5. ht

(eval-when-compile
  (el-get-bundle 'ht))

(with-delayed-execution-priority-high
  (message "Install ht...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/ht"))))

5.6. lv

(eval-when-compile
  (el-get-bundle 'lv))

(with-delayed-execution-priority-high
  (message "Install lv...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/lv"))))

5.7. spinner

(eval-when-compile
  (el-get-bundle 'spinner))

(with-delayed-execution-priority-high
  (message "Install spinner...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/spinner"))))

5.8. shrink-path

(eval-when-compile
  (el-get-bundle 'shrink-path))

(with-delayed-execution-priority-high
  (message "Install shrink-path...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/shrink-path"))))

5.9. compat

(eval-when-compile
  (el-get-bundle 'compat))

(with-delayed-execution-priority-high
  (message "Install compat...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/compat"))))

5.10. posframe

(eval-when-compile
  (el-get-bundle 'posframe))

(with-delayed-execution-priority-high
  (message "Install posframe...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/posframe"))))

6. Language

6.1. apache-mode

(eval-when-compile
  (el-get-bundle 'apache-mode))

(with-delayed-execution
  (message "Install apache-mode")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/apache-mode")))
  (when (autoload-if-found '(apache-mode) "apache-mode" nil t)
    (push '("\\.htaccess$" . apache-mode) auto-mode-alist)))

6.2. c++-mode

(with-eval-after-load 'c++-mode
  (add-hook 'c++-mode-hook 'lsp-deferred))

6.3. c-mode

(with-eval-after-load 'c-mode
  (add-hook 'c-mode-hook 'lsp-deferred))

6.4. clojure-mode

(eval-when-compile
  (el-get-bundle 'clojure-mode))

(with-delayed-execution
  (message "Install clojure-mode")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/clojure-mode")))
  (when (autoload-if-found '(clojure-mode) "clojure-mode" nil t)
    (push '("\\.clj$" . clojure-mode) auto-mode-alist)
    (push '("\\.cljs$" . clojure-mode) auto-mode-alist)
    (push '("\\.cljstyle$" . clojure-mode) auto-mode-alist)))

6.5. cmake-mode

(eval-when-compile
  (el-get-bundle 'cmake-mode))

(with-delayed-execution
  (message "Install cmake...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/cmake-mode")))
  (when (autoload-if-found '(cmake-mode) "cmake-mode" nil t)
    (push '("\\.cmake$" . cmake-mode) auto-mode-alist)))

6.6. coffee-mode

(eval-when-compile
  (el-get-bundle 'coffee-mode))

(with-delayed-execution
  (message "Install coffee-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/coffee-mode")))
  (when (autoload-if-found '(coffee-mode) "coffee-mode" nil t)
    (push '("\\.coffee$" . coffee-mode) auto-mode-alist)))

6.7. csharp-mode

(eval-when-compile
  (el-get-bundle 'csharp-mode))

(with-delayed-execution
  (message "Install csharp-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/csharp-mode")))
  (when (autoload-if-found '(csharp-mode) "csharp-mode" nil t)
    (push '("\\.cs$" . csharp-mode) auto-mode-alist)))

6.8. css-mode

(with-eval-after-load 'css-mode
  (add-hook 'css-mode-hook 'lsp-deferred))

6.9. csv-mode

(eval-when-compile
  (el-get-bundle 'csv-mode))

(with-delayed-execution
  (message "Install csv-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/csv-mode")))
  (when (autoload-if-found '(csv-mode) "csv-mode" nil t)
    (push '("\\.csv$" . csv-mode) auto-mode-alist)))

6.10. dart-mode

(eval-when-compile
  (el-get-bundle 'dart-mode))

(with-delayed-execution
  (message "Install dart-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/dart-mode")))
  (when (autoload-if-found '(dart-mode) "dart-mode" nil t)
    (push '("\\.dart$" . dart-mode) auto-mode-alist)))

6.11. docker-compose-mode

(eval-when-compile
  (el-get-bundle 'docker-compose-mode))

(with-delayed-execution
  (message "Install docker-comopse-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/docker-compose-mode")))
  (when (autoload-if-found '(docker-compose-mode) "docker-compose-mode" nil t)
    (push '("\\docker-compose*" . docker-compose-mode) auto-mode-alist)))

6.12. dockerfile-mode

(eval-when-compile
  (el-get-bundle 'dockerfile-mode))

(with-delayed-execution
  (message "Install dockerfile-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/dockerfile-mode")))
  (when (autoload-if-found '(dockerfile-mode) "dockerfile-mode" nil t)
    (push '("\\Dockerfile$" . dockerfile-mode) auto-mode-alist)))

6.13. dotenv-mode

(eval-when-compile
  (el-get-bundle 'dotenv-mode))

(with-delayed-execution
  (message "Install dotenv-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/dotenv-mode")))
  (when (autoload-if-found '(dotenv-mode) "dotenv-mode" nil t)
    (push '(".env" . dotenv-mode) auto-mode-alist)
    (push '("\\.env\\..*\\'" . dotenv-mode) auto-mode-alist)))

6.14. emmet-mode

(eval-when-compile
  (el-get-bundle 'emmet-mode))

(with-delayed-execution
  (message "Install emmet-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/emmet-mode")))
  (when (autoload-if-found '(emmet-mode) "emmet-mode" nil t)
    (add-hook 'html-mode-hook 'emmet-mode)
    (add-hook 'web-mode-hook 'emmet-mode)
    (add-hook 'css-mode-hook 'emmet-mode)
    (add-hook 'nxml-mode-hook 'emmet-mode)
    (add-hook 'php-blade-mode 'emmet-mode)
    (add-hook 'typescript-tsx-mode-hook 'emmet-mode))
  (with-eval-after-load 'emmet-mode
    (when (boundp 'emmet-mode-keymap)
      (define-key emmet-mode-keymap (kbd "C-j") nil)
      (define-key emmet-mode-keymap (kbd "M-j") 'emmet-expand-line))
    (eval-and-compile
      (setq emmet-self-closing-tag-style "")
      (setq emmet-indent-after-insert nil))))

6.15. fish-mode

(eval-when-compile
  (el-get-bundle 'fish-mode))

(with-delayed-execution
  (message "Install fish-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/fish-mode")))
  (when (autoload-if-found '(fish-mode) "fish-mode" nil t)
    (push '("\\.fish$" . fish-mode) auto-mode-alist))
  (with-eval-after-load "fish-mode"
    (eval-and-compile
      (setq fish-enable-auto-indent t))))

6.16. git-modes

(eval-when-compile
  (el-get-bundle 'git-modes))

(with-delayed-execution
  (message "Install git-modes...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/git-modes")))
  (when (autoload-if-found '(gitignore-mode gitconfig-mode) "git-modes" nil t)
    (push '("\\.dockerignore$" . gitignore-mode) auto-mode-alist)
    (push '("\\.gitconfig$" . gitconfig-mode) auto-mode-alist)
    (push '("\\.git-pr-release$" . gitconfig-mode) auto-mode-alist)
    (push '("\\.gitignore$" . gitignore-mode) auto-mode-alist)
    (push '("\\.prettierignore$" . gitignore-mode) auto-mode-alist)
    (push '("\\.editorconfig$" . gitconfig-mode) auto-mode-alist)))

6.17. glsl-mode

(eval-when-compile
  (el-get-bundle 'glsl-mode))

(with-delayed-execution
  (message "Install glsl-mode")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/glsl-mode")))
  (when (autoload-if-found '(glsl-mode) "glsl-mode" nil t)
    (push '("\\.vsh$" . glsl-mode) auto-mode-alist)
    (push '("\\.fsh$" . glsl-mode) auto-mode-alist)))

6.18. go-mode

(eval-when-compile
  (el-get-bundle 'go-mode))

(with-delayed-execution
  (message "Install go-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/go-mode")))
  (when (autoload-if-found '(go-mode) "go-mode" nil t)
    (push '("\\.go$" . go-mode) auto-mode-alist)
    (push '("^go.mod$" . go-dot-mod-mode) auto-mode-alist))
  (with-eval-after-load 'go-mode
    (add-hook 'go-mode-hook 'lsp-deferred)
    (add-hook 'before-save-hook 'gofmt-before-save)
    (eval-and-compile
      (setq gofmt-command "goimports"))))

6.19. gradle-mode

(eval-when-compile
  (el-get-bundle 'gradle-mode))

(with-delayed-execution
  (message "Install gradle-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/gradle-mode")))
  (when (autoload-if-found '(gradle-mode) "gradle-mode" nil t)
    (push '("\\.gradle$" . gradle-mode) auto-mode-alist)))

6.20. graphql-mode

(eval-when-compile
  (el-get-bundle 'graphql-mode))

(with-delayed-execution
  (message "Install graphql-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/graphql-mode")))
  (when (autoload-if-found '(graphql-mode) "graphql-mode" nil t)
    (add-to-list 'auto-mode-alist '("\\.graphql\\'" . graphql-mode))
    (add-to-list 'auto-mode-alist '("\\.graphql\\'" . graphql-mode)))
  (with-eval-after-load 'graphql-mode
    (eval-and-compile
      (setq graphql-indent-level 4))))

6.21. haskell-mode

(eval-when-compile
  (el-get-bundle "haskell/haskell-mode"))

(with-delayed-execution
  (message "Install haskell-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/haskell-mode")))
  (when (autoload-if-found '(haskell-mode) "haskell-mode" nil t)
    (push '("\\.hs$" . haskell-mode) auto-mode-alist)
    (push '("\\.cable$" . haskell-mode) auto-mode-alist)))

6.22. java-mode

(with-delayed-execution
  (message "Install java-mode...")
  (when (autoload-if-found '(java-mode) "java-mode" nil t)
    (push '("\\.java$" . java-mode) auto-mode-alist)))

6.23. js2-mode

(eval-when-compile
  (el-get-bundle 'js2-mode))

(with-delayed-execution
  (message "Install js2-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/js2-mode")))
  (when (autoload-if-found '(js2-mode) "js2-mode" nil t)
    (push '("\\.js$" . js2-mode) auto-mode-alist))
  (with-eval-after-load 'js2-mode
    (add-hook 'js2-mode-hook 'lsp-deferred)))

6.24. json-mode

(eval-when-compile
  (el-get-bundle "Sterlingg/json-snatcher")
  (el-get-bundle "joshwnj/json-mode"))

(with-delayed-execution
  (message "Install json-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/json-snatcher")))
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/json-mode")))
  (when (autoload-if-found '(json-mode) "json-mode" nil t)
    (push '("\\.json$" . json-mode) auto-mode-alist)
    (push '("\\.textlintrc$" . json-mode) auto-mode-alist)
    (push '("\\.prettierrc$" . json-mode) auto-mode-alist)))

6.25. jq-mode

(eval-when-compile
  (el-get-bundle 'jq-mode))

(with-delayed-execution
  (message "Install jq-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/jq-mode")))
  (when (autoload-if-found '(jq-interactively) "jq-mode" nil t)
    (with-eval-after-load 'json-mode
      (define-key json-mode-map (kbd "C-c C-j") #'jq-interactively)))
  (with-eval-after-load 'ob-babel
    (org-babel-do-load-languages 'org-babel-load-languages
                                 '((jq . t)))))

6.26. lisp-mode

(with-delayed-execution
  (when (autoload-if-found '(lisp-mode) "lisp-mode" nil t)
    (push '("\\.lemrc$" . lisp-mode) auto-mode-alist)
    (push '("\\.Cask$" . lisp-mode) auto-mode-alist)))

6.27. markdown-mode

(eval-when-compile
  (el-get-bundle markdown-mode))

(with-delayed-execution
  (message "Install markdown-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/poly-markdown")))
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/markdown-mode")))
  (when (autoload-if-found '(markdown-mode) "markdown-mode" nil t)
    (push '("\\.md$" . markdown-mode) auto-mode-alist)
    (push '("\\.markdown$" . markdown-mode) auto-mode-alist)))

6.28. makefile-mode

(with-delayed-execution
  (when (autoload-if-found '(makefile-mode) "makefile-mode" nil t)
    (push '("\\.mk$" . makefile-mode) auto-mode-alist)
    (push '("Makefile" . makefile-mode) auto-mode-alist)))

6.29. neon-mode

(eval-when-compile
  (el-get-bundle 'neon-mode))

(with-delayed-execution
  (message "Install neon-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/neon-mode")))
  (when (autoload-if-found '(neon-mode) "neon-mode" nil t)
    (add-to-list 'auto-mode-alist '("\\.neon\\'" . neon-mode))))

6.30. nix-mode

(eval-when-compile
  (el-get-bundle 'nix-mode))

(with-delayed-execution
  (message "Install nix-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/nix-mode")))
  (when (autoload-if-found '(nix-mode) "nix-mode" nil t)
    (add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))))

6.31. nginx-mode

(eval-when-compile
  (el-get-bundle 'nginx-mode))

(with-delayed-execution
  (message "Install nginx-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/nginx-mode")))
  (when (autoload-if-found '(nginx-mode) "nginx-mode" nil t)
    (push '("nginx\\.conf\\'" . nginx-mode) auto-mode-alist)
    (push '("/nginx/.+\\.conf\\'" . nginx-mode) auto-mode-alist)
    (push '("/nginx/sites-\\(?:available\\|enabled\\)/" . nginx-mode) auto-mode-alist))
  (with-eval-after-load 'nginx-mode
    (eval-and-compile
      (setq nginx-indent-tabs-mode t))))

6.32. nov-mode

(eval-when-compile
  (el-get-bundle 'esxml :url "https://github.com/tali713/esxml.git")
  (el-get-bundle 'nov :url "https://depp.brause.cc/nov.el.git"))

(with-delayed-execution
  (message "Install nov-mode...")
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/esxml")))
  (add-to-list 'load-path (locate-user-emacs-file (concat "el-get/nov")))
  (when (autoload-if-found '(nov-mode) "nov" nil t)
    (push '("\\.epub\\'" . nov-mode) auto-mode-alist)))

6.33. php-mode

(eval-when-compile
  (el-get-bundle "emacs-php/php-mode"))

(with-delayed-execution
  (message "Install php-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/php-mode/lisp"))
  (when (autoload-if-found '(php-mode) "php-mode" nil t)
    (push '("\\.php$" . php-mode) auto-mode-alist)
    (add-hook 'php-mode-hook #'(lambda ()
                                 (let ((lsp-enabled-clients '(phpactor)))
                                   (lsp))))))

6.34. phpt-mode

(eval-when-compile
  (el-get-bundle 'phpt-mode))

(with-delayed-execution
  (message "Install phpt-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/phpt-mode"))
  (when (autoload-if-found '(phpt-mode) "phpt-mode" nil t)
    (push '("\\.phpt$" . phpt-mode) auto-mode-alist)))

6.35. plantuml-mode

(eval-when-compile
  (el-get-bundle 'plantuml-mode))

(with-delayed-execution
  (message "Install plantuml-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/plantuml-mode"))
  (when (autoload-if-found '(plantuml-mode) "plantuml-mode" nil t)
    (push '("\\.pu$" . plantuml-mode) auto-mode-alist)))

6.36. prisma-mode

(eval-when-compile
  (el-get-bundle 'prisma-mode
    :url "https://github.com/pimeys/emacs-prisma-mode.git"))

(with-delayed-execution
  (message "Install prisma-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/prisma-mode"))
  (when (autoload-if-found '(prisma-mode) "prisma-mode" nil t)
    (push '("\\.prisma" . prisma-mode) auto-mode-alist)))

6.37. processing-mode

(eval-when-compile
  (el-get-bundle 'processing-mode))

(with-delayed-execution
  (message "Install processing-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/processing-mode"))
  (when (autoload-if-found '(processing-mode) "processing-mode" nil t)
    (push '("\\.pde$" . processing-mode) auto-mode-alist))
  (with-eval-after-load 'processing-mode
    (eval-and-compile
      (setq-default processing-location "/opt/processing/processing-java")
      (setq-default processing-output-dir "/tmp"))))

6.38. python-mode

(eval-when-compile
  (el-get-bundle 'python-mode))

(with-delayed-execution
  (message "Install python-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/python-mode"))
  (when (autoload-if-found '(python-mode) "python-mode" nil t)
    (push '("\\.py$" . python-mode) auto-mode-alist)))

6.39. robots-txt-mode

(eval-when-compile
  (el-get-bundle 'robots-txt-mode
    :url "https://github.com/emacs-php/robots-txt-mode.git"))

(with-delayed-execution
  (message "Install robots-txt-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/robots-txt-mode"))
  (when (autoload-if-found '(robots-txt-mode) "robots-txt-mode" nil t)
    (push '("/robots\\.txt\\'" . robots-txt-mode) auto-mode-alist)))

6.40. ruby-mode

(eval-when-compile
  (el-get-bundle 'ruby-mode))

(with-delayed-execution
  (message "Install ruby-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ruby-mode"))
  (when (autoload-if-found '(ruby-mode) "ruby-mode" nil t)
    (push '("\\.rb$" . ruby-mode) auto-mode-alist)
    (push '("\\.irbrc$" . ruby-mode) auto-mode-alist)
    (push '("Capfile" . ruby-mode) auto-mode-alist)
    (push '("Gemfile" . ruby-mode) auto-mode-alist)
    (push '("Schemafile" . ruby-mode) auto-mode-alist)
    (push '(".pryrc" . ruby-mode) auto-mode-alist)
    (push '("Fastfile" . ruby-mode) auto-mode-alist)
    (push '("Matchfile" . ruby-mode) auto-mode-alist)
    (push '("Procfile" . ruby-mode) auto-mode-alist)
    (push '(".git-pr-template" . ruby-mode) auto-mode-alist)
    (push '(".gemrc" . ruby-mode) auto-mode-alist))
  (with-eval-after-load 'ruby-mode
    (eval-and-compile
      (setq-default ruby-insert-encoding-magic-comment nil))))

6.41. rust-mode

(eval-when-compile
  (el-get-bundle 'rust-mode))

(with-delayed-execution
  (message "Install rust-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/rust-mode"))
  (when (autoload-if-found '(rust-mode) "rust-mode" nil t)
    (push '("\\.rs$" . rust-mode) auto-mode-alist)
    (add-hook 'rust-mode-hook 'lsp)))

6.42. scala-mode

(eval-when-compile
  (el-get-bundle 'scala-mode))

(with-delayed-execution
  (message "Install scala-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/scala-mode"))
  (when (autoload-if-found '(scala-mode) "scala-mode" nil t)
    (push '("\\.scala$" . scala-mode) auto-mode-alist)))

6.43. scheme-mode

(with-delayed-execution
  (message "Install scheme...")
  (when (require 'scheme)
    (with-eval-after-load 'scheme
      (eval-and-compile
        (setq scheme-program-name "gosh -i")))))

6.44. scss-mode

(eval-when-compile
  (el-get-bundle 'scss-mode))

(with-delayed-execution
  (message "Install scss-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/scss-mode"))
  (when (autoload-if-found '(scss-mode) "scss-mode" nil t)
    (push '("\\.scss$" . scss-mode) auto-mode-alist)
    (add-hook 'scss-mode-hook #'(lambda ()
                                  (let ((lsp-diagnostics-provider :none))
                                    (lsp-deferred))))))

6.45. slim-mode

(eval-when-compile
  (el-get-bundle 'slim-mode))

(with-delayed-execution
  (message "Install slim-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/slim-mode"))
  (when (autoload-if-found '(slim-mode) "slim-mode" nil t)
    (push '("\\.slim$" . slim-mode) auto-mode-alist)))

6.46. solidity-mode

(eval-when-compile
  (el-get-bundle 'solidity-mode))

(with-delayed-execution
  (message "Install solidity-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/solidity-mode"))
  (when (autoload-if-found '(solidity-mode) "solidity-mode" nil t)
    (push '("\\.sol$" . solidity-mode) auto-mode-alist)))

6.47. ssh-config-mode

(eval-when-compile
  (el-get-bundle 'ssh-config-mode))

(with-delayed-execution
  (message "Install ssh-config-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ssh-config-mode"))
  (when (autoload-if-found '(ssh-config-mode ssh-known-hosts-mode ssh-authorized-keys-mode) "ssh-config-mode" nil t)
    (push '("/\\.ssh/config\\(\\.d/.*\\.conf\\)?\\'" . ssh-config-mode) auto-mode-alist)
    (push '("/sshd?_config\\(\\.d/.*\\.conf\\)?\\'" . ssh-config-mode) auto-mode-alist)
    (push '("/known_hosts\\'" . ssh-known-hosts-mode) auto-mode-alist)
    (push '("/authorized_keys2?\\'" . ssh-authorized-keys-mode) auto-mode-alist)))

6.48. sql-mode

(with-eval-after-load 'sql
  (load-library "sql-indent")
  (eval-and-compile
    (setq sql-mysql-login-params '(server port user password database))))

6.49. swift-mode

(eval-when-compile
  (el-get-bundle 'swift-mode))

(with-delayed-execution
  (message "Install swift-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/swift-mode"))
  (when (autoload-if-found '(swift-mode) "swift-mode" nil t)
    (push '("\\.swift$" . swift-mode) auto-mode-alist)))

6.50. terraform-mode

(eval-when-compile
  (el-get-bundle 'terraform-mode))

(with-delayed-execution
  (message "Install terraform-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/terraform-mode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/hcl-mode"))
  (when (autoload-if-found '(terraform-mode) "terraform-mode" nil t)
    (push '("\\.tf$" . terraform-mode) auto-mode-alist)))

6.51. text-mode

(with-delayed-execution
  (when (autoload-if-found '(conf-space-mode) "text-mode" nil t)
    (push '("\\.tigrc$" . conf-space-mode) auto-mode-alist)
    (push '("\\.editrc$" . conf-space-mode) auto-mode-alist)
    (push '("\\.inputrc$" . conf-space-mode) auto-mode-alist)
    (push '("\\.colorrc$" . conf-space-mode) auto-mode-alist)))

6.52. toml-mode

(eval-when-compile
  (el-get-bundle 'toml-mode))

(with-delayed-execution
  (message "Install toml-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/toml-mode"))
  (when (autoload-if-found '(toml-mode) "toml-mode" nil t)
    (push '("\\.toml$" . toml-mode) auto-mode-alist)))

6.53. typescript-mode

(eval-when-compile
  (el-get-bundle 'typescript-mode))

(with-delayed-execution
  (message "Install typescript-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/typescript-mode"))

  (when (autoload-if-found '(typescript-mode typescript-tsx-mode) "typescript-mode" nil t)
    (define-derived-mode typescript-tsx-mode typescript-mode "tsx")

    ;; for ts/deno
    (push '("\\.ts$" . typescript-mode) auto-mode-alist)
    (defun run-local-vars-mode-hook ()
      "Run `major-mode' hook after the local variables have been processed."
      (run-hooks (intern (concat (symbol-name major-mode) "-local-vars-hook"))))
    (add-hook 'hack-local-variables-hook 'run-local-vars-mode-hook)
    (add-hook 'typescript-mode-local-vars-hook #'lsp)

    ;; for tsx
    (push '("\\.tsx$" . typescript-tsx-mode) auto-mode-alist)
    (add-hook 'typescript-tsx-mode-hook 'lsp-deferred)))

6.54. v-mode

(eval-when-compile
  (el-get-bundle 'v-mode))

(with-delayed-execution
  (message "Install v-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/v-mode"))
  (when (autoload-if-found '(v-mode v-menu v-format-buffer) "v-mode" nil t)
    (push '("\\(\\.v?v\\|\\.vsh\\)$" . v-mode) auto-mode-alist))
  (with-eval-after-load 'v-mode
    (when (boundp 'v-mode-map)
      (define-key v-mode-map (kbd "M-z") 'v-menu)
      (define-key v-mode-map (kbd "C-c C-f") 'v-format-buffer))))

6.55. vue-mode

(eval-when-compile
  (el-get-bundle 'ssass-mode)
  (el-get-bundle 'vue-html-mode)
  (el-get-bundle "purcell/mmm-mode")
  (el-get-bundle "Fanael/edit-indirect")
  (el-get-bundle 'vue-mode))

(with-delayed-execution
  (message "Install vue-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ssass-mode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/vue-html-mode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/mmm-mode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/edit-indirect"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/vue-mode"))

  (with-eval-after-load 'vue-html-mode
    (setq vue-html-extra-indent 4))

  (when (autoload-if-found '(vue-mode) "vue-mode" nil t)
    (push '("\\.vue$" . vue-mode) auto-mode-alist)))

6.56. vimrc-mode

(eval-when-compile
  (el-get-bundle 'vimrc-mode))

(with-delayed-execution
  (message "Install vimrc-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/vimrc-mode"))
  (when (autoload-if-found '(vimrc-mode) "vimrc-mode" nil t)
    (push '("\\.vim\\(rc\\)?\\'" . vimrc-mode) auto-mode-alist)))

6.57. wat-mode

(eval-when-compile
  (el-get-bundle 'wat-mode :url "https://github.com/devonsparks/wat-mode.git"))

(with-delayed-execution
  (message "Install wat-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/wat-mode"))
  (when (autoload-if-found '(wat-mode) "wat-mode" nil t)
    (push '("\\.wat?\\'" . wat-mode) auto-mode-alist)))

6.58. web-mode

(eval-when-compile
  (el-get-bundle 'web-mode))

(with-delayed-execution
  (message "Install web-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/web-mode"))
  (when (autoload-if-found '(web-mode) "web-mode" nil t)
    (push '("\\.html?\\'" . web-mode) auto-mode-alist)
    (push '("\\.erb?\\'" . web-mode) auto-mode-alist)
    (push '("\\.gsp?\\'" . web-mode) auto-mode-alist)
    (push '("\\.svg\\'" . web-mode) auto-mode-alist))
  (with-eval-after-load 'web-mode
    (eval-and-compile
      (setq web-mode-comment-style 2)
      (setq web-mode-enable-auto-pairing nil)
      (setq web-mode-enable-auto-indentation nil))))

6.59. web-php-blade-mode

(eval-when-compile
  (el-get-bundle 'web-php-blade-mode
                 :url "https://github.com/takeokunn/web-php-blade-mode.git"))

(with-delayed-execution
  (message "Install web-php-blade-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/web-php-blade-mode"))
  (when (autoload-if-found '(web-php-blade-mode) "web-php-blade-mode" nil t)
    (push '("\\.blade.php$" . web-php-blade-mode) auto-mode-alist)))

6.60. yaml-mode

(eval-when-compile
  (el-get-bundle 'yaml-mode))

(with-delayed-execution
  (message "Install yaml-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/yaml-mode"))
  (when (autoload-if-found '(yaml-mode) "yaml-mode" nil t)
    (push '("\\.ya?ml$" . yaml-mode) auto-mode-alist)
    (push '("phpstan.neon" . yaml-mode) auto-mode-alist)))

7. Lisp

7.1. Basic

7.1.1. paredit

(eval-when-compile
  (el-get-bundle 'paredit))

(with-delayed-execution-priority-high
  (message "Install paredit...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/paredit"))
  (when (autoload-if-found '(enable-paredit-mode) "paredit" nil t)
    ;; hooks
    (add-hook 'lisp-mode-hook 'enable-paredit-mode)
    (add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
    (add-hook 'clojure-mode-hook 'enable-paredit-mode)
    (add-hook 'lisp-interacton-mode-hook 'enable-paredit-mode)
    (add-hook 'lisp-data-mode-hook 'enable-paredit-mode)
    (add-hook 'eval-expression-minibuffer-setup-hook #'paredit-mode)

    ;; global keybind
    (global-set-key (kbd "C-c f") 'paredit-forward-slurp-sexp)
    (global-set-key (kbd "M-s") 'paredit-splice-sexp)))

7.1.2. rainbow-delimiter

(eval-when-compile
  (el-get-bundle 'rainbow-delimiters))

(with-delayed-execution
  (message "Install rainbow-delimiters...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/rainbow-delimiters"))
  (when (autoload-if-found '(rainbow-delimiters-mode-enable) "rainbow-delimiters" nil t)
    (with-eval-after-load 'rainbow-delimiters
      (add-hook 'prog-mode-hook 'rainbow-delimiters-mode-enable))))

7.2. CommonLisp

7.2.1. TODO slime/slime-company

;; (eval-when-compile
;;   (el-get-bundle 'slime)
;;   (el-get-bundle 'slime-company))

;; (with-delayed-execution
;;   (message "Install slime...")
;;   (message "Install slime-company...")
;;   (add-to-list 'load-path (locate-user-emacs-file "el-get/slime-company"))
;;   (load (expand-file-name "~/.roswell/helper.el"))
;;   (when (require 'slime-company)
;;     (slime-setup '(slime-fancy slime-company)))
;;   (with-eval-after-load 'slime
;;     (eval-and-compile
;;       (setq slime-net-coding-system 'utf-8-unix))))

7.2.2. hyperspec

(with-delayed-execution
  (define-key lisp-mode-map (kbd "C-c h") 'hyperspec-lookup)
  (with-eval-after-load 'hyperspec
    (defadvice common-lisp-hyperspec (around common-lisp-hyperspec-around activate)
      (let ((buf (current-buffer)))
        ad-do-it
        (switch-to-buffer buf)
        (pop-to-buffer "*eww*")))
    (defadvice common-lisp-hyperspec-lookup-reader-macro (around common-lisp-hyperspec-lookup-reader-macro-around activate)
      (let ((buf (current-buffer)))
        ad-do-it
        (switch-to-buffer buf)
        (pop-to-buffer "*eww*")))
    (defadvice common-lisp-hyperspec-format (around common-lisp-hyperspec-format activate)
      (let ((buf (current-buffer)))
        ad-do-it
        (switch-to-buffer buf)
        (pop-to-buffer "*eww*")))
    (eval-and-compile
      (setq common-lisp-hyperspec--reader-macros nil)
      (setq common-lisp-hyperspec--format-characters nil))))

7.2.3. my/slime-history

(with-delayed-execution
  (when (autoload-if-found '(my/slime-history) "slime" nil t)
    (define-key slime-repl-mode-map (kbd "C-c C-r") 'my/slime-history)
    (defun my/slime-history ()
      (interactive)
      (if (and (fboundp '-distinct)
               (fboundp 'f-read-text))
          (insert
           (completing-read
            "choice history: "
            (-distinct (read (f-read-text "~/.slime-history.eld")))))))))

7.3. EmacsLisp

7.3.1. elisp-slime-nav

(eval-when-compile
  (el-get-bundle 'elisp-slime-nav))

(with-delayed-execution
  (message "Install eslisp-slime-nav...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/elisp-slime-nav"))
  (with-eval-after-load 'elisp-slime-nav
    (add-hook 'emacs-lisp-mode-hook 'elisp-slime-nav-mode)
    (add-hook 'ielm-mode-hook 'elisp-slime-nav-mode)))

7.3.2. nameless

(eval-when-compile
  (el-get-bundle 'nameless))

(with-delayed-execution
  (message "Install nameless...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/nameless"))
  (when (autoload-if-found '(nameless-mode) "nameless" nil t)
    (add-hook 'ielm-mode-hook 'nameless-mode)
    (add-hook 'emacs-lisp-mode-hook 'nameless-mode)))

7.3.3. my/ielm-history

(with-delayed-execution
  (when (autoload-if-found '(my/ielm-history) "ielm" nil t))
  (defun my/ielm-history ()
    (interactive)
    (insert
     (completing-read
      "choice history: "
      (progn
        (let ((history nil)
              (comint-input-ring nil))
          (dotimes (index (ring-length comint-input-ring))
            (push (ring-ref comint-input-ring index) history))
          history))))))

7.4. Clojure

7.4.1. cider

(eval-when-compile
  (el-get-bundle 'parseclj-parser
                 :url "https://github.com/clojure-emacs/parseclj.git")
  (el-get-bundle 'parseedn)
  (el-get-bundle 'queue)
  (el-get-bundle 'spinner)
  (el-get-bundle 'seq)
  (el-get-bundle 'sesman)
  (el-get-bundle 'cider))

(with-delayed-execution
  (message "Install cider...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/parseclj"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/parseedn"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/queue"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/spinner"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/seq"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/sesman"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/cider"))

  (when (autoload-if-found '(cider
                             cider-format-buffer
                             cider-switch-to-last-clojure-buffer
                             my/cider-switch-to-last-clojure-buffer) "cider" nil t)
    (add-hook 'before-save-hook 'cider-format-buffer t t)

    ;; (defun my/cider-switch-to-last-clojure-buffer ()
    ;;   (interactive)
    ;;   (let* ((window (split-window-right))
    ;;          (buffer (current-buffer)))
    ;;     (set-window-buffer window buffer)
    ;;     (cider-switch-to-last-clojure-buffer)))
    ;; (define-key cider-mode-map (kbd "C-c C-z") #'my/cider-switch-to-last-clojure-buffer)
    )

  (with-eval-after-load 'cider-mode
    (eval-and-compile
      (setq cider-font-lock-dynamically '(macro core function var))))

  (with-eval-after-load 'cider-repl
    (eval-and-compile
      (setq cider-repl-buffer-size-limit 1000000)
      (setq cider-repl-wrap-history t)
      (setq cider-repl-history-size 10000)
      (setq cider-repl-tab-command #'indent-for-tab-command)
      (setq cider-repl-display-in-current-window t)))

  (with-eval-after-load 'cider-eval
    (eval-and-compile
      (setq cider-show-error-buffer nil)
      (setq cider-auto-select-error-buffer nil))))

7.4.2. clojure-cheatsheet

(eval-when-compile
  (el-get-bundle 'async)
  (el-get-bundle 'helm)
  (el-get-bundle 'clojure-cheatsheet
                 :url "https://github.com/clojure-emacs/clojure-cheatsheet.git"))

(with-delayed-execution
  (message "Install clojure-cheatsheet...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/async"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/helm"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/clojure-cheatsheet"))
  (autoload-if-found '(clojure-cheatsheet) "clojure-cheatsheet" nil t))

7.4.3. kibit-helper

(eval-when-compile
  (el-get-bundle 'kibit-helper))

(with-delayed-execution
  (message "Install kibit-helper...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/kibit-helper"))
  (autoload-if-found '(kibit kibit-current-file kibit-accept-proposed-change) "kibit-helper" nil t))

7.4.4. clj-refactor

(eval-when-compile
  (el-get-bundle 'inflections)
  (el-get-bundle 'clj-refactor))

(with-delayed-execution
  (message "Install clj-refactor...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/inflections"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/clj-refactor"))
  (when (autoload-if-found '(clj-refactor-mode cljr-add-keybindings-with-prefix) "clj-refactor" nil t)
    (add-hook 'clojure-mode-hook #'(lambda ()
                                     (clj-refactor-mode 1)
                                     (cljr-add-keybindings-with-prefix "C-c C-m")))))

7.4.5. inf-clojure

(eval-when-compile
  (el-get-bundle 'inf-clojure
                 :url "https://github.com/clojure-emacs/inf-clojure.git"))

(with-delayed-execution
  (message "Install inf-clojure...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/inf-clojure"))
  (autoload-if-found '(inf-clojure) "inf-clojure" nil t))

8. Awesome Package

8.1. Check

8.1.1. flycheck

(eval-when-compile
  (el-get-bundle 'flycheck))

(with-delayed-execution
  (message "Install flycheck...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/flycheck"))
  (autoload-if-found '(flycheck-mode) "flycheck" nil t))

8.2. Search

8.2.1. el-get

(eval-when-compile
  (el-get-bundle abo-abo/swiper))

(with-delayed-execution-priority-high
  (message "Install swiper...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/swiper")))

8.2.2. prescient

(eval-when-compile
  (el-get-bundle 'prescient))

(with-delayed-execution-priority-high
  (message "Install prescient...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/prescient"))
  (when (autoload-if-found '(prescient-persist-mode) "prescient" nil t)
    (prescient-persist-mode))
  (with-eval-after-load 'prescient
    (eval-and-compile
      (setq prescient-aggressive-file-save t))))

8.2.3. swiper

(with-delayed-execution
  (when (autoload-if-found '(my/swiper) "swiper" nil t)
    (defun my/swiper ()
      (interactive)
      (let ((word (thing-at-point 'symbol 'no-properties)))
        (swiper word)))
    (global-set-key (kbd "C-o") 'my/swiper)))

8.2.4. counsel

(with-delayed-execution-priority-high
  (when (autoload-if-found '(counsel-mode counsel-compile) "counsel" nil t)
    (global-set-key (kbd "C-x m") 'counsel-compile)
    (counsel-mode 1)))

8.2.5. ivy

(with-delayed-execution-priority-high
  (when (autoload-if-found '(ivy-mode ivy-read ivy-completing-read) "ivy" nil t)
    (add-hook 'minibuffer-setup-hook (lambda ()
                                       (ivy-mode 1))))
  (with-eval-after-load 'ivy
    (eval-and-compile
      (setq enable-recursive-minibuffers t)
      (setq ivy-use-virtual-buffers t))))

8.2.6. ivy-rich

(eval-when-compile
  (el-get-bundle 'ivy-rich))

(with-delayed-execution-priority-high
  (message "Install ivy-rich...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ivy-rich"))
  (when (autoload-if-found '(ivy-rich-mode) "ivy-rich" nil t)
    (ivy-rich-mode 1))
  (with-eval-after-load 'ivy-rich
    (eval-and-compile
      (setq ivy-rich-path-style 'abbrev))))

8.2.7. ivy-prescient

(eval-when-compile
  (el-get-bundle 'ivy-prescient))

(with-delayed-execution-priority-high
  (message "Install ivy-prescient...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ivy-prescient"))
  (when (autoload-if-found '(ivy-prescient-mode) "ivy-prescient" nil t)
    (ivy-prescient-mode)))

8.3. Theme

8.3.1. all-the-icons

(eval-when-compile
  (el-get-bundle 'all-the-icons))

(with-delayed-execution-priority-high
  (message "Install all-the-icons...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/all-the-icons")))

8.3.2. all-the-icons-dired

(eval-when-compile
  (el-get-bundle 'all-the-icons-dired))

(with-delayed-execution-priority-high
  (message "Install all-the-icons-dired...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/all-the-icons-dired"))
  (when (autoload-if-found '(all-the-icons-dired-mode) "all-the-icons-dired")
    (add-hook 'dired-mode-hook 'all-the-icons-dired-mode))
  (with-eval-after-load 'all-the-icons-dired-mode
    (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)))

8.3.3. all-the-icons-ivy-rich

(eval-when-compile
  (el-get-bundle 'all-the-icons-ivy-rich))

(with-delayed-execution-priority-high
  (message "Install all-the-icons-ivy-rich...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/all-the-icons-ivy-rich"))
  (when (autoload-if-found '(all-the-icons-ivy-rich-mode) "all-the-icons-ivy-rich" nil t)
    (all-the-icons-ivy-rich-mode 1))
  (with-eval-after-load 'all-the-icons-ivy-rich
    (eval-and-compile
      (setq all-the-icons-ivy-rich-icon t)
      (setq all-the-icons-ivy-rich-color-icon t)
      (setq all-the-icons-ivy-rich-icon-size 1.0)
      (setq all-the-icons-ivy-rich-project t)
      (setq all-the-icons-ivy-rich-field-width 80)
      (setq inhibit-compacting-font-caches t))))

8.3.4. dashboard

(eval-when-compile
  (el-get-bundle 'dashboard))

(with-delayed-execution-priority-high
  (message "Install dashboard...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/dashboard"))
  (autoload-if-found '(dashboard-refresh-buffer) "dashboard" nil t)
  (with-eval-after-load 'dashboard
    (eval-and-compile
      (setq dashboard-startup-banner 4)
      (setq dashboard-items '((recents . 10))))))

8.3.5. doom-themes

(eval-when-compile
  (el-get-bundle 'doom-themes))

(with-delayed-execution-priority-high
  (add-to-list 'load-path (locate-user-emacs-file "el-get/doom-themes"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/doom-themes/extensions"))
  (when (require 'doom-themes)
    (load-theme 'doom-dracula t))
  (with-eval-after-load 'doom-themes
    (eval-and-compile
      (setq doom-themes-enable-bold t)
      (setq doom-themes-enable-italic t)))

  (when (autoload-if-found '(doom-themes-enable-org-fontification) "doom-themes-ext-org" nil t)
    (doom-themes-enable-org-fontification))

  (when (autoload-if-found '(doom-themes-neotree-config) "doom-themes-ext-neotree" nil t)
    (doom-themes-neotree-config)))

8.3.6. doom-modeline

(eval-when-compile
  (el-get-bundle 'doom-modeline))

(with-delayed-execution-priority-high
  (add-to-list 'load-path (locate-user-emacs-file "el-get/doom-modeline"))
  (when (autoload-if-found '(doom-modeline-mode line-number-mode column-number-mode) "doom-modeline" nil t)
    (add-hook 'after-init-hook 'doom-modeline-mode)
    (doom-modeline-mode 1)
    (line-number-mode 0)
    (column-number-mode 0))
  (with-eval-after-load 'doom-modeline
    (eval-and-compile
      (setq doom-modeline-buffer-file-name-style 'truncate-with-project)
      (setq doom-modeline-icon t)
      (setq doom-modeline-major-mode-icon t)
      (setq doom-modeline-minor-modes nil)
      (setq inhibit-compacting-font-caches t))))

8.3.7. hl-line

(with-delayed-execution
  (when (autoload-if-found '(global-hl-line-mode) "hl-line-mode" nil t)
    (when (not window-system)
      (global-hl-line-mode)))
  (with-eval-after-load 'hl-line
    (set-face-attribute 'hl-line nil :inherit nil)
    (set-face-background 'hl-line "#444642")))

8.3.8. neotree

(eval-when-compile
  (el-get-bundle 'neotree))

(with-delayed-execution-priority-high
  (message "Install neotree...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/neotree"))
  (when (autoload-if-found '(my/neotree-toggle) "neotree" nil t)
    (global-set-key (kbd "C-q") 'my/neotree-toggle))
  (with-eval-after-load 'neotree
    (defun my/neotree-toggle ()
      (interactive)
      (let ((default-directory (locate-dominating-file default-directory ".git")))
        (if (and (fboundp 'neo-global--window-exists-p)
                 (neo-global--window-exists-p))
            (neotree-hide)
          (neotree-dir default-directory))))
    (eval-and-compile
      (setq neo-autorefresh nil)
      (setq neo-theme 'nerd2)
      (setq neo-show-hidden-files t)
      (setq neo-window-fixed-size nil))
    (if window-system
        (defun neo-buffer--insert-fold-symbol (name &optional file-name)
          (or
           (and
            (equal name 'open)
            (insert
             (format " %s "
                     (all-the-icons-icon-for-dir file-name "down"))))
           (and
            (equal name 'close)
            (insert
             (format " %s "
                     (all-the-icons-icon-for-dir file-name "right"))))
           (and
            (equal name 'leaf)
            (insert
             (format " %s "
                     (all-the-icons-icon-for-file file-name)))))))))

8.3.9. nyan-mode

(eval-when-compile
  (el-get-bundle 'nyan-mode))

(with-delayed-execution-priority-high
  (message "Install nyan-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/nyan-mode"))
  (when (autoload-if-found '(nyan-mode) "nyan-mode" nil t)
    (add-hook 'doom-modeline-mode-hook 'nyan-mode))
  (with-eval-after-load 'nyan-mode
    (eval-and-compile
      (setq nyan-cat-face-number 4)
      (setq nyan-animate-nyancat t))))

8.4. Project

8.4.1. projectile

(eval-when-compile
  (el-get-bundle 'projectile))

(with-delayed-execution-priority-high
  (message "Install projectile...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/projectile"))
  (when (autoload-if-found '(projectile-mode projectile-command-map my/update-projectile-known-projects) "projectile" nil t)
    (global-set-key (kbd "M-p") 'projectile-command-map)
    (global-set-key (kbd "C-c p") 'projectile-command-map)

    (projectile-mode +1)
    (add-hook 'projectile-mode-hook 'my/update-projectile-known-projects)
    (defun my/update-projectile-known-projects ()
      (interactive)
      (setq projectile-known-projects (mapcar
                                       (lambda (x)
                                         (abbreviate-file-name (concat x "/")))
                                       (split-string (shell-command-to-string "ghq list --full-path"))))))
  (with-eval-after-load 'projectile
    (eval-and-compile
      (setq projectile-switch-project-action 'projectile-dired)
      (setq projectile-enable-caching t))))

8.4.2. counsel-projectile

(eval-when-compile
  (el-get-bundle 'counsel-projectile))

(with-delayed-execution-priority-high
  (message "Install counsel-projectile...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/counsel-projectile"))
  (when (autoload-if-found '(counsel-projectile-mode) "counsel-projectile" nil t)
    (define-key projectile-mode-map (kbd "M-p") 'projectile-command-map)
    (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
    (counsel-projectile-mode +1))
  (with-eval-after-load 'counsel-projectile
    (eval-and-compile
      (setq counsel-projectile-grep-initial-input '(ivy-thing-at-point))
      (setq counsel-projectile-ag-initial-input '(ivy-thing-at-point))
      (setq counsel-projectile-rg-initial-input '(ivy-thing-at-point)))))

8.5. Refactor

8.5.1. emr

(eval-when-compile
  (el-get-bundle 'popup)
  (el-get-bundle 'list-utils)
  (el-get-bundle 'iedit)
  (el-get-bundle 'emr))

(with-delayed-execution
  (message "Install emr...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/popup"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/list-utils"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/iedit"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/emr"))
  (when (autoload-if-found '(emr-show-refactor-menu) "emr" nil t)
    (define-key prog-mode-map (kbd "M-RET") 'emr-show-refactor-menu)))

8.6. Completion

8.6.1. company

(eval-when-compile
  (el-get-bundle 'company))

(with-delayed-execution
  (message "Install company...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company"))
  (when (autoload-if-found '(global-company-mode) "company" nil t)
    (global-company-mode))
  (with-eval-after-load 'company
    (define-key company-active-map (kbd "C-n") 'company-select-next)
    (define-key company-active-map (kbd "C-p") 'company-select-previous)
    (when (require 'company-css)
      (push 'company-css company-backends))
    (when (require 'company-elisp)
      (push 'company-elisp company-backends))
    (eval-and-compile
      (setq company-minimum-prefix-length 2))))

8.6.2. company-box

(eval-when-compile
  (el-get-bundle 'frame-local)
  (el-get-bundle 'company-box))

(with-delayed-execution
  (message "Install company-box...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/frame-local"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-box"))
  (when (autoload-if-found '(company-box-mode) "company-box" nil t)
    (when window-system
      (add-hook 'company-mode-hook 'company-box-mode)))
  (with-eval-after-load 'company-box
    (setq company-box-doc-enable nil)))

8.6.3. company-dockerfile

(eval-when-compile
  (el-get-bundle 'company-dockerfile
    :url "https://github.com/takeokunn/company-dockerfile.git"))

(with-delayed-execution
  (message "Install company-dockerfile...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-dockerfile"))
  (when (autoload-if-found '(company-dockerfile) "company-dockerfile" nil t)
    (when (boundp 'company-backends)
      (push 'company-dockerfile company-backends))))

8.6.4. company-glsl

(eval-when-compile
  (el-get-bundle 'company-glsl))

(with-delayed-execution
  (message "Install company-glsl...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-glsl"))
  (when (autoload-if-found '(company-glsl) "company-glsl" nil t)
    (when (boundp 'company-backends)
      (push 'company-glsl company-backends))))

8.6.5. company-c-headers

(eval-when-compile
  (el-get-bundle 'company-c-headers))

(with-delayed-execution
  (message "Install company-c-headers...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-c-headers"))
  (when (autoload-if-found '(company-c-headers) "company-c-headers" nil t)
    (when (boundp 'company-backends)
      (push 'company-c-headers company-backends))))

8.6.6. company-shell

(eval-when-compile
  (el-get-bundle "takeokunn/company-shell"))

(with-delayed-execution
  (message "Install company-shell...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-shell"))
  (when (autoload-if-found '(company-shell company-shell-env company-fish-shell) "company-shell" nil t)
    (when (boundp 'company-backends)
      (push 'company-shell company-backends)
      (push 'company-shell-env company-backends)
      (push 'company-fish-shell company-backends))))

8.6.7. company-terraform

(eval-when-compile
  (el-get-bundle 'company-terraform))

(with-delayed-execution
  (message "Install company-terraform...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-terraform"))
  (when (autoload-if-found '(company-terraform) "company-terraform" nil t)
    (with-eval-after-load 'company
      (when (boundp 'company-backends)
        (push 'company-terraform company-backends)))))

8.6.8. company-nginx

(eval-when-compile
  (el-get-bundle 'company-nginx))

(with-delayed-execution
  (message "Install company-nginx...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-nginx"))
  (when (autoload-if-found '(company-nginx) "company-nginx" nil t)
    (when (boundp 'company-backends)
      (push 'company-nginx company-backends))))

8.6.9. company-gemoji

(eval-when-compile
  (el-get-bundle 'company-gemoji
                 :url "https://github.com/takeokunn/company-gemoji.git"))

(with-delayed-execution
  (message "Install company-gemoji...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/company-gemoji"))
  (when (autoload-if-found '(company-gemoji) "company-gemoji" nil t)
    (when (boundp 'company-backends)
      (push 'company-gemoji company-backends))))

8.7. Snippet

8.7.1. yasnippet

(eval-when-compile
  (el-get-bundle "yasnippet"))

(with-delayed-execution
  (message "Install yasnippet...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/yasnippet"))
  (when (autoload-if-found '(yas-global-mode) "yasnippet" nil t)
    (yas-global-mode 1))
  (with-eval-after-load 'yasnippet
    (eval-and-compile
      (setq tab-width 4))))

8.7.2. ivy-yasnippet

(eval-when-compile
  (el-get-bundle "mkcms/ivy-yasnippet"))

(with-delayed-execution
  (message "Install ivy-yasnippet...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ivy-yasnippet"))
  (when (autoload-if-found '(ivy-yasnippet) "ivy-yasnippet" nil t)
    (global-set-key (kbd "C-c y") 'ivy-yasnippet)
    (global-set-key (kbd "C-c C-y") 'ivy-yasnippet)))

8.8. LSP

8.8.1. lsp-mode

(eval-when-compile
  (el-get-bundle lsp-mode))

(with-delayed-execution
  (message "Install lsp-mode...")

  (add-to-list 'load-path (locate-user-emacs-file "el-get/lsp-mode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/lsp-mode/clients"))

  (when (autoload-if-found '(lsp-lens) "lsp-lens" nil t)
    (add-hook 'lsp-mode-hook #'lsp-lens-mode))

  (when (autoload-if-found '(lsp-diagnostics-mode) "lsp-diagnostics" nil t)
    (add-hook 'lsp-mode-hook #'lsp-diagnostics-mode))

  (when (autoload-if-found '(lsp-completion-mode) "lsp-completion" nil t)
    (add-hook 'lsp-mode-hook #'lsp-completion-mode))

  (when (autoload-if-found '(lsp-dired-mode) "lsp-dired" nil t)
    (add-hook 'lsp-mode-hook #'lsp-dired-mode))

  (when (autoload-if-found '(lsp-modeline-code-actions-mode lsp-modeline-diagnostics-mode) "lsp-modeline" nil t)
    (add-hook 'lsp-mode-hook #'lsp-modeline-code-actions-mode)
    (add-hook 'lsp-mode-hook #'lsp-modeline-diagnostics-mode))

  (when (autoload-if-found '(lsp-headerline-breadcrumb-mode) "lsp-headerline" nil t)
    (add-hook 'lsp-mode-hook #'lsp-headerline-breadcrumb-mode))

  (with-eval-after-load 'lsp-mode
    (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]vendor")
    (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]storage")
    (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]docs")
    (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]docker")
    (eval-and-compile
      (setq lsp-idle-delay 0.8)
      (setq lsp-enable-links nil)
      (setq lsp-log-io nil)))

  (with-eval-after-load 'flycheck
    (add-hook 'lsp-mode-hook #'flycheck-mode))

  (with-eval-after-load 'lsp-completion
    (eval-and-compile
      (setq lsp-prefer-capf t)))

  (with-eval-after-load 'lsp-diagnostics
    (eval-and-compile
      (setq lsp-diagnostics-provider :flycheck)))

  (with-eval-after-load 'lsp-icons
    (eval-and-compile
      (unless window-system
        (setq lsp-headerline-breadcrumb-icons-enable nil)))))

8.8.2. dap-mode

(eval-when-compile
  (el-get-bundle 'bui)
  (el-get-bundle 'pfuture)
  (el-get-bundle 'treemacs)
  (el-get-bundle 'tree-mode)
  (el-get-bundle 'posframe)
  (el-get-bundle 'hydra)
  (el-get-bundle 'dap-mode))

(with-delayed-execution
  (message "Install dap-mode...")

  (add-to-list 'load-path (locate-user-emacs-file "el-get/bui"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/pfuture"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/treemacs/src/elisp"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/tree-mode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/posframe"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/lsp-treemacs"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/hydra"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/dap-mode"))

  (when (autoload-if-found '(dap-mode) "dap-mode" nil t)
    (add-hook 'lsp-mode-hook 'dap-mode))

  (with-eval-after-load 'dap-mode
    (define-key dap-mode-map (kbd "C-c d") 'dap-breakpoint-toggle))

  (when (autoload-if-found '(dap-ui-mode) "dap-ui" nil t)
    (add-hook 'dap-mode-hook 'dap-ui-mode)
    (add-hook 'dap-mode-hook 'dap-ui-controls-mode))

  (when (autoload-if-found '(dap-tooltip-mode) "dap-mouse" nil t)
    (add-hook 'dap-mode-hook 'tooltip-mode)
    (add-hook 'dap-mode-hook 'dap-tooltip-mode))

  (when (autoload-if-found '(dap-php-setup) "dap-php" nil t)
    (add-hook 'php-mode-hook 'dap-php-setup))

  (with-eval-after-load 'dap-php
    (dap-register-debug-template "Laravel Run Configuration"
                                 (list :type "php"
                                       :request "launch"
                                       :mode "remote"
                                       :host "localhost"
                                       :port "9003"))
    (eval-and-compile
      (setq dap-php-debug-path "~/.ghq/github.com/xdebug/vscode-php-debug")
      (setq dap-php-debug-program `("node" ,(f-join dap-php-debug-path "out/phpDebug.js")))))

  (when (autoload-if-found '(dap-node-setup) "dap-node" nil t)
    (add-hook 'js2-mode-hook 'dap-node-setup))

  (when (autoload-if-found '(dap-go-setup) "dap-go" nil t)
    (add-hook 'go-mode-hook 'dap-go-setup))

  (when (autoload-if-found '(dap-ruby-setup) "dap-ruby" nil t)
    (add-hook 'ruby-mode-hook 'dap-ruby-setup)))

8.8.3. lsp-ui

(eval-when-compile
  (el-get-bundle lsp-ui))

(with-delayed-execution
  (message "Install lsp-ui...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/lsp-ui"))
  (when (autoload-if-found '(lsp-ui-mode) "lsp-ui" nil t)
    (add-hook 'lsp-mode-hook #'lsp-ui-mode))
  (with-eval-after-load 'lsp-ui
    (eval-and-compile
      (setq lsp-ui-doc-include-signature t)
      (setq lsp-ui-doc-delay 0.7)
      (setq lsp-ui-doc-max-height 30))))

8.9. Git

8.9.1. magit

(eval-when-compile
  (el-get-bundle magit/transient)
  (el-get-bundle magit/ghub)
  (el-get-bundle magit/magit-popup)
  (el-get-bundle magit/with-editor)
  (el-get-bundle magit/magit))

(with-delayed-execution-priority-high
  (message "Install magit...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/transient/lisp"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ghub/lisp"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/magit-pop"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/with-editor/lisp"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/magit/lisp"))
  (when (autoload-if-found '(global-git-commit-mode) "git-commit" nil t)
    (global-git-commit-mode))

  (with-delayed-execution
    (when (autoload-if-found '(magit-status magit-blame) "magit")
      (defun my/magit-status ()
        (interactive)
        (let ((default-directory (locate-dominating-file default-directory ".git")))
          (magit-status)))
      (global-set-key (kbd "C-x g") #'my/magit-status)
      (global-set-key (kbd "C-x G") #'magit-blame))

    (with-eval-after-load 'magit
      (eval-and-compile
        (setq magit-refresh-status-buffer nil)))))

8.9.2. magit-forge

(eval-when-compile
  (el-get-bundle 'treepy)
  (el-get-bundle 'yaml)
  (el-get-bundle "emacscollective/closql")
  (el-get-bundle "skeeto/emacsql")
  (el-get-bundle "magit/forge"))

(with-delayed-execution
  (add-to-list 'load-path (locate-user-emacs-file "el-get/treepy"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/yaml"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/closql"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/emacsql"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ghub"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/forge/lisp"))
  (add-hook 'magit-mode-hook (lambda ()
                               (require 'forge))))

8.10. Shell

8.10.1. exec-path-from-shell

(eval-when-compile
  (el-get-bundle exec-path-from-shell))

(with-delayed-execution-priority-high
  (message "Install exec-path-from-shell...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/exec-path-from-shell"))

  (when (autoload-if-found '(exec-path-from-shell-initialize) "exec-path-from-shell")
    (exec-path-from-shell-initialize))

  (with-eval-after-load 'exec-path-from-shell
    (eval-and-compile
      (setq exec-path-from-shell-variables '("PATH" "GEM_HOME" "GOROOT" "GOPATH" "LSP_USE_PLISTS")))))

8.11. Cpp

8.11.1. clang-format

(eval-when-compile
  (el-get-bundle 'clang-format))

(with-delayed-execution
  (message "Install clang-format...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/clang-format"))
  (when (autoload-if-found '(clang-format-buffer) "clang-format" nil t)
    (add-hook 'before-save-hook (lambda ()
                                  (when (member major-mode '(c-mode c++-mode))
                                    (clang-format-buffer))))))

8.11.2. inferior-cling

(eval-when-compile
  (el-get-bundle "brianqq/inferior-cling"))

(with-delayed-execution
  (message "Install inferior-cling...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/inferior-cling")))

8.12. JavaScript/TypeScript

8.12.1. js2-refactor

(eval-when-compile
  (el-get-bundle 'js2-refactor))

(with-delayed-execution
  (add-to-list 'load-path (locate-user-emacs-file "el-get/js2-refactor"))
  (when (autoload-if-found '(js2-refactor-mode) "js2-refactor" nil t)
    (add-hook 'js2-mode-hook 'js2-refactor-mode)
    (add-hook 'typescript-mode-hook 'js2-refactor-mode)))

8.12.2. tree-sitter

(eval-when-compile
  (el-get-bundle 'tsc)
  (el-get-bundle "emacs-tree-sitter/tree-sitter-langs")
  (el-get-bundle 'tree-sitter))

(with-delayed-execution
  (message "Install tree-sitter...")

  (add-to-list 'load-path (locate-user-emacs-file "el-get/tsc"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/tree-sitter-langs"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/tree-sitter"))

  (when (autoload-if-found '(tree-sitter-mode tree-sitter-require tree-sitter-hl-add-patterns) "tree-sitter" nil t)
    (add-hook 'typescript-tsx-mode-hook 'tree-sitter-mode)
    (when (require 'tree-sitter-langs)
      (tree-sitter-require 'tsx))
    (tree-sitter-hl-add-patterns 'tsx
      [(call_expression
        ;; styled.div``
        function: (member_expression
                   object: (identifier) @function.call
                   (.eq? @function.call "styled"))
        arguments: ((template_string) @property.definition
                    (.offset! @property.definition 0 1 0 -1)))
       (call_expression
        ;; styled(Component)``
        function: (call_expression
                   function: (identifier) @function.call
                   (.eq? @function.call "styled"))
        arguments: ((template_string) @property.definition
                    (.offset! @property.definition 0 1 0 -1)))])

    (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx)))

  (when (autoload-if-found '(tree-sitter-hl-mode) "tree-sitter-hl" nil t)
    (add-hook 'tree-sitter-after-on-hook 'tree-sitter-hl-mode)))

8.13. Ruby

8.13.1. robe

(eval-when-compile
  (el-get-bundle 'robe))

(with-delayed-execution
  (message "Install robe...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/robe"))
  (when (autoload-if-found '(robe-mode inf-ruby-console-auto) "robe" nil t)
    (add-hook 'ruby-mode-hook 'robe-mode)
    (when (boundp 'company-backends)
      (push 'company-robe company-backends))))

8.13.2. rubocop

(eval-when-compile
  (el-get-bundle 'rubocop))

(with-delayed-execution
  (message "Install rubocop...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/rubocop"))
  (when (autoload-if-found '(rubocop-mode) "rubocop" nil t)
    (add-hook 'ruby-mode-hook 'rubocop-mode)))

8.13.3. ruby-refactor

(eval-when-compile
  (el-get-bundle 'ruby-refactor))

(with-delayed-execution
  (message "Install ruby-refactor...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ruby-refactor"))
  (when (autoload-if-found '(ruby-refactor-mode-launch) "ruby-refactor" nil t)
    (add-hook 'ruby-mode-hook 'ruby-refactor-mode-launch)))

8.13.4. inf-ruby

(eval-when-compile
  (el-get-bundle 'inf-ruby))

(with-delayed-execution
  (message "Install inf-ruby...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/inf-ruby"))
  (when (autoload-if-found '(inf-ruby inf-ruby-minor-mode) "inf-ruby")
    (add-hook 'ruby-mode-hook 'inf-ruby-minor-mode)
    (defun takeokunn/irb-history ()
      (interactive)
      (when (and (fboundp '-distinct)
                 (fboundp 's-lines)
                 (fboundp 'f-read-text))
        (insert
         (completing-read
          "choose history: "
          (mapcar #'list (-distinct (s-lines (f-read-text "~/.irb_history"))))))))))

8.14. SQL

8.14.1. sql-indent

(eval-when-compile
  (el-get-bundle 'sql-indent))

(with-delayed-execution
  (message "Install sql-indent...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/sql-indent"))
  (when (autoload-if-found '(sqlind-setup sqlind-minor-mode) "sql-indent" nil t)
    (add-hook 'sql-mode-hook (lambda ()
                               (sqlind-setup)
                               (sqlind-minor-mode)))))

8.15. PHP

8.15.1. psysh

(eval-when-compile
  (el-get-bundle 'psysh))

(with-delayed-execution
  (message "Install psysh...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/psysh")))

8.15.2. laravel-tinker-repl

(eval-when-compile
  (el-get-bundle "takeokunn/laravel-tinker-repl.el"))

(with-delayed-execution
  (message "Install laravel-tinker-repl...")
  ;; (add-to-list 'load-path (locate-user-emacs-file "el-get/laravel-tinker-repl.el"))
  (add-to-list 'load-path "~/.ghq/github.com/takeokunn/laravel-tinker-repl.el")
  (autoload-if-found '(laravel-tinker-repl) "laravel-tinker-repl" nil t))

8.15.3. emacs-php-doc-block

(eval-when-compile
  (el-get-bundle "moskalyovd/emacs-php-doc-block"))

(with-delayed-execution
  (message "Install emacs-php-doc-block...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/emacs-php-doc-block"))
  (autoload-if-found '(php-doc-block) "php-doc-block" nil t))

8.16. Markdown

8.16.1. poly-markdown

(eval-when-compile
  (el-get-bundle 'polymode)
  (el-get-bundle 'poly-markdown))

(with-delayed-execution
  (add-to-list 'load-path (locate-user-emacs-file "el-get/polymode"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/poly-markdown"))
  (when (autoload-if-found '(poly-markdown-mode) "poly-markdown" nil t)
    (add-to-list 'auto-mode-alist '("\\.md" . poly-markdown-mode))))

8.16.2. markdown-preview-mode

(eval-when-compile
  (el-get-bundle 'web-server)
  (el-get-bundle 'websocket)
  (el-get-bundle 'markdown-preview-mode))

(with-delayed-execution
  (message "Install markdown-preview-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/web-server"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/websocket"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/markdown-preview-mode"))

  (autoload-if-found '(markdown-preview-open-browser markdown-preview-mode) "markdown-preview-mode" nil t)

  (with-eval-after-load 'markdown-preview-mode
    (eval-and-compile
      (setq markdown-preview-stylesheets (list "http://thomasf.github.io/solarized-css/solarized-light.min.css")))))

8.17. Fish

8.17.1. fish-repl

(eval-when-compile
  (el-get-bundle 'fish-repl
                 :url "https://github.com/takeokunn/fish-repl.el.git"))

(with-delayed-execution
  (message "Install fish-repl...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/fish-repl"))
  (autoload-if-found '(fish-repl) "fish-repl" nil t))

8.18. NodeJS

8.18.1. nodejs-repl

(eval-when-compile
  (el-get-bundle 'nodejs-repl
                 :url "https://github.com/abicky/nodejs-repl.el.git"))

(with-delayed-execution
  (message "Install nodejs-repl...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/nodejs-repl"))
  (when (autoload-if-found '(nodejs-repl) "nodejs-repl" nil t)
    (add-hook 'js-mode-hook
              (lambda ()
                (define-key js-mode-map (kbd "C-x C-e") 'nodejs-repl-send-last-expression)
                (define-key js-mode-map (kbd "C-c C-j") 'nodejs-repl-send-line)
                (define-key js-mode-map (kbd "C-c C-r") 'nodejs-repl-send-region)
                (define-key js-mode-map (kbd "C-c C-c") 'nodejs-repl-send-buffer)
                (define-key js-mode-map (kbd "C-c C-l") 'nodejs-repl-load-file)
                (define-key js-mode-map (kbd "C-c C-z") 'nodejs-repl-switch-to-repl)))))

8.19. File

8.19.1. recentf

(with-delayed-execution
  (when (autoload-if-found '(recentf-mode) "recentf" nil t)
    (add-hook 'emacs-startup-hook (lambda ()
                                    (recentf-mode 1))))
  (with-eval-after-load 'recentf
    (eval-and-compile
      (setq recentf-max-saved-items 10000)
      (setq recentf-auto-cleanup 'never)
      (setq recentf-save-file  "~/.emacs.d/.recentf")
      (setq recentf-exclude '(".recentf")))))

8.19.2. open-junk-file

(eval-when-compile
  (el-get-bundle 'open-junk-file))

(with-delayed-execution
  (message "Install open-junk-file...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/open-junk-file"))
  (when (autoload-if-found '(open-junk-file my/open-junk-file) "open-junk-file" nil t)
    (defun my/open-junk-file ()
      (interactive)
      (ivy-mode 0)
      (let ((default-directory (format-time-string "~/.emacs.d/.junk/%Y-%m%d-%H%M%S." (current-time))))
        (open-junk-file))
      (ivy-mode 1))
    (global-set-key (kbd "C-x j") 'my/open-junk-file))
  (with-eval-after-load 'open-junk-file
    (eval-and-compile
      (setq open-junk-file-format ""))))

8.20. Cursor

8.20.1. multiple-cursors

(eval-when-compile
  (el-get-bundle 'multiple-cursors))

(with-delayed-execution
  (add-to-list 'load-path (locate-user-emacs-file "el-get/multiple-cursors"))
  (when (require 'multiple-cursors)
    (global-set-key (kbd "C->") 'mc/mark-next-like-this)
    (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
    (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)))

8.21. Other

8.21.1. ansi-color

(with-delayed-execution
  (message "Install ansi-color...")
  (autoload 'ansi-color-for-comint-mode-on "ansi-color" "Set `ansi-color-for-comint-mode' to t." t)
  (when (autoload-if-found '(ansi-color-for-comint-mode-on) "ansi-color" nil t)
    (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
    (add-hook 'compilation-filter-hook #'(lambda ()
                                           (ansi-color-apply-on-region (point-min) (point-max))))))

8.21.2. auto-save-buffers-enhanced

(eval-when-compile
  (el-get-bundle 'auto-save-buffers-enhanced))

(with-delayed-execution
  (message "Install auto-save-buffers-enhanced...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/auto-save-buffers-enhanced"))
  (autoload-if-found '(auto-save-buffers-enhanced) "auto-save-buffers-enhanced" nil t)
  (with-eval-after-load 'auto-save-buffers-enhanced
    (eval-and-compile
      (setq auto-save-buffers-enhanced-interval 10))))

8.21.3. amx

(eval-when-compile
  (el-get-bundle 'amx))

(with-delayed-execution-priority-high
  (message "Install amx...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/amx"))
  (with-eval-after-load 'amx))

8.21.4. avy

(eval-when-compile
  (el-get-bundle 'avy))

(with-delayed-execution
  (message "Install avy...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/avy"))
  (when (autoload-if-found '(avy-goto-word-1) "avy" nil t)
    (global-set-key (kbd "C-:") 'avy-goto-word-1))
  (with-eval-after-load 'avy
    (setq avy-background t)))

8.21.5. avy-zap

(eval-when-compile
  (el-get-bundle 'avy-zap))

(with-delayed-execution
  (message "Install avy-zap...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/avy-zap"))
  (when (autoload-if-found '(avy-zap-up-to-char-dwim) "avy-zap" nil t)
    (global-set-key (kbd "M-z") 'avy-zap-up-to-char-dwim)))

8.21.6. browse-url

(with-eval-after-load 'browse-url
  (eval-and-compile
    (setq browse-url-browser-function 'eww-browse-url)))

8.21.7. define-word

(eval-when-compile
  (el-get-bundle 'define-word))

(with-delayed-execution
  (message "Install define-word...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/define-word"))
  (defun my/define-word ()
    (interactive)
    (if (use-region-p)
        (call-interactively #'define-word-at-point)
      (call-interactively #'define-word)))
  (with-eval-after-load 'define-word
    (eval-and-compile
      (setq define-word-displayfn-alist
            '((wordnik . takeokunn/define-word--display-in-buffer)
              (openthesaurus . takeokunn/define-word--display-in-buffer)
              (webster . takeokunn/define-word--display-in-buffer)
              (weblio . takeokunn/define-word--display-in-buffer))))))

8.21.8. ddskk

(eval-when-compile
  (el-get-bundle 'ddskk))

(with-delayed-execution-priority-high
  (message "Install ddskk...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ddskk"))

  (when (autoload-if-found '(skk-mode) "skk" nil t)
    (global-set-key (kbd "C-x C-j") 'skk-mode))

  (with-eval-after-load 'skk-vars
    (eval-and-compile
      (setq skk-byte-compile-init-file t)))

  (with-eval-after-load 'skk-vars
    (eval-and-compile
      (setq skk-isearch-mode-enable 'always)))

  (with-eval-after-load 'skk-vars
    (eval-and-compile
      (setq skk-preload t)))

  (with-eval-after-load 'skk
    (eval-and-compile
      (setq default-input-method "japanese-skk"))))

8.21.9. ddskk-posframe

(eval-when-compile
  (el-get-bundle 'ddskk-posframe))

(with-delayed-execution
  (message "Install ddskk-posframe...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ddskk-posframe"))
  (when (autoload-if-found '(ddskk-posframe-mode) "ddskk-posframe" nil t)
    (add-hook 'skk-mode-hook #'ddskk-posframe-mode)))

8.21.10. editorconfig

(eval-when-compile
  (el-get-bundle 'editorconfig))

(with-delayed-execution
  (message "Install editorconfig...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/editorconfig"))
  (when (autoload-if-found '(editorconfig-mode) "editorconfig" nil t)
    (when (require 'editorconfig-core)
      (editorconfig-mode 1))))

8.21.11. esup

(eval-when-compile
  (el-get-bundle 'esup))

(with-delayed-execution
  (message "Install esup...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/esup"))
  (autoload-if-found '(esup) "esup" nil t))

8.21.12. epa-file

(with-delayed-execution
  (when (autoload-if-found '(epa-file-enable) "epa-file" nil t)
    (epa-file-enable)))

8.21.13. expand-region

(eval-when-compile
  (el-get-bundle 'expand-region))

(with-delayed-execution
  (message "Install expand-region...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/expand-region"))
  (when (autoload-if-found '(er/expand-region er/contract-region) "expand-region" nil t)
    (transient-mark-mode)
    (global-set-key (kbd "C-M-@") 'er/expand-region)))

8.21.14. font-lock-studio

(eval-when-compile
  (el-get-bundle 'font-lock-studio))

(with-delayed-execution
  (message "Install font-lock-studio...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/font-lock-studio")))

8.21.15. gcmh

(eval-when-compile
  (el-get-bundle 'gcmh))

(with-delayed-execution
  (message "Install gcmh...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/gcmh"))
  (when (autoload-if-found '(gcmh-mode) "gcmh" nil t)
    (defvar my/gcmh-status nil)

    (gcmh-mode 1)

    (advice-add #'garbage-collect
                :before
                (defun my/gcmh-log-start (&rest _)
                  (when gcmh-verbose
                    (setq my/gcmh-status "Running GC..."))))

    (advice-add #'gcmh-message
                :override
                (defun my/gcmh-message (format-string &rest args)
                  (setq akirak/gcmh-status
                        (apply #'format-message format-string args))
                  (run-with-timer 2 nil
                                  (lambda ()
                                    (setq my/gcmh-status nil)))))

    (with-eval-after-load 'gcmh
      (eval-and-compile
        (setq gcmh-verbose t)
        (setq gcmh-idle-delay 15)))))

8.21.16. google-this

(eval-when-compile
  (el-get-bundle 'google-this))

(with-delayed-execution
  (message "Install google-this...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/google-this"))
  (when (autoload-if-found '(google-this) "google-this" nil t)
    (global-set-key (kbd "M-g") 'google-this)))

8.21.17. goto-addr

(with-delayed-execution
  (when (autoload-if-found '(goto-address-prog-mode goto-address-mode) "goto-address" nil t)
    (add-hook 'prog-mode-hook 'goto-address-prog-mode)
    (add-hook 'text-mode-hook 'goto-address-mode)))

8.21.18. hl-todo

(eval-when-compile
  (el-get-bundle 'hl-todo))

(with-delayed-execution
  (message "Install hl-todo...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/hl-todo"))
  (when (autoload-if-found '(global-hl-todo-mode) "hl-todo" nil t)
    (global-hl-todo-mode))
  (with-eval-after-load 'hl-todo
    (eval-and-compile
      (setq hl-todo-keyword-faces
            '(("TODO"   . "#FF0000")
              ("FIXME"  . "#FF0000")
              ("DEBUG"  . "#A020F0")
              ("GOTCHA" . "#FF4500")
              ("STUB"   . "#1E90FF"))))))

8.21.19. TODO highlight-indent-guides

(eval-when-compile
  (el-get-bundle 'highlight-indent-guides))

(with-delayed-execution
  (message "Install highlight-indent-guides...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/highlight-indent-guides"))
  (when (autoload-if-found '(highlight-indent-guides-mode) "highlight-indent-guides" nil t)
    ;; (add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
    )
  (with-eval-after-load 'highlight-indent-guides
    (eval-and-compile
      (setq highlight-indent-guides-method 'bitmap))))

8.21.20. htmlize

(eval-when-compile
  (el-get-bundle 'htmlize))

(with-delayed-execution
  (message "Install htmlize...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/htmlize"))
  (with-eval-after-load 'htmlize))

8.21.21. keyfreq

(eval-when-compile
  (el-get-bundle 'keyfreq))

(with-delayed-execution
  (message "Install keyfreq...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/keyfreq"))
  (when (autoload-if-found '(keyfreq-mode keyfreq-autosave-mode) "keyfreq" nil t)
    (add-hook 'emacs-startup-hook (lambda ()
                                    (keyfreq-mode 1)
                                    (keyfreq-autosave-mode 1)))))

8.21.22. lorem ipsum

(eval-when-compile
  (el-get-bundle 'lorem-ipsum))

(with-delayed-execution
  (message "Install lorem-ipsum...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/lorem-ipsum"))
  (when (autoload-if-found '(lorem-ipsum-insert-sentences lorem-ipsum-insert-paragraphs lorem-ipsum-insert-list) "lorem-ipsum" nil t)
    (global-set-key (kbd "C-c C-l s") 'lorem-ipsum-insert-sentences)
    (global-set-key (kbd "C-c C-l p") 'lorem-ipsum-insert-paragraphs)
    (global-set-key (kbd "C-c C-l l") 'lorem-ipsum-insert-list)))

8.21.23. minimap

(eval-when-compile
  (el-get-bundle 'minimap))

(with-delayed-execution
  (message "Install minimap...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/minimap"))
  (when (autoload-if-found '(minimap-mode) "minimap" nil t)
    (global-set-key (kbd "C-c m") 'minimap-mode))
  (with-eval-after-load 'minimap
    (setq minimap-window-location 'right)
    (setq minimap-update-delay 0.2)
    (setq minimap-minimum-width 20)
    (setq minimap-major-modes '(prog-mode org-mode))))

8.21.24. origami

(eval-when-compile
  (el-get-bundle 'origami))

(with-delayed-execution
  (message "Install origami...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/origami"))
  (when (autoload-if-found '(global-origami-mode origami-recursively-toggle-node origami-recursively-toggle-node) "origami" nil t)
    (global-origami-mode)
    (global-set-key (kbd "C-c t") 'origami-recursively-toggle-node)
    (global-set-key (kbd "C-c C-t") 'origami-recursively-toggle-node)))

8.21.25. persistent-scratch

(eval-when-compile
  (el-get-bundle 'persistent-scratch))

(with-delayed-execution
  (message "Install persistent-scratch...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/persistent-scratch"))
  (when (autoload-if-found '(persistent-scratch-setup-default) "persistent-scratch" nil t)
    (persistent-scratch-setup-default)
    (with-eval-after-load 'persistent-scratch
      (eval-and-compile
        (setq persistent-scratch-autosave-interval 100)))))

8.21.26. TODO pdf-tools

(eval-when-compile
  (el-get-bundle 'pdf-tools))

(with-delayed-execution
  (message "Install pdf-tools...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/pdf-tools/lisp"))
  ;; (when (autoload-if-found '(pdf-tools-install) "pdf-tools" nil t)
  ;;   (pdf-tools-install))
  )

8.21.27. popwin

(eval-when-compile
  (el-get-bundle 'popwin))

(with-delayed-execution
  (message "Install popwin...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/popwin"))
  (when (autoload-if-found '(popwin-mode) "popwin" nil t)
    (add-hook 'emacs-startup-hook (lambda ()
                                    (popwin-mode 1)))))

8.21.28. power-mode

(eval-when-compile
  (el-get-bundle 'power-mode
                 :url "https://github.com/elizagamedev/power-mode.el.git"))

(with-delayed-execution
  (message "Install power-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/power-mode"))
  (autoload-if-found '(power-mode) "power-mode" nil t))

8.21.29. proced

(with-delayed-execution
  (when (autoload-if-found '(proced) "proced" nil t)
    (add-hook 'proced-mode-hook #'(lambda ()
                                    (proced-toggle-auto-update 1))))
  (with-eval-after-load 'proced
    (define-key proced-mode-map (kbd "j") #'next-line)
    (define-key proced-mode-map (kbd "k") #'previous-line)
    (eval-and-compile
      (setq proced-format 'long))))

8.21.30. redacted

(eval-when-compile
  (el-get-bundle 'redacted
                 :url "https://github.com/bkaestner/redacted.el.git"))

(with-delayed-execution
  (message "Install redacted...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/redacted"))
  (when (autoload-if-found '(my/redacted-mode) "redacted" nil t)
    (defun my/redacted-mode ()
      (interactive)
      (read-only-mode (if redacted-mode -1 1))
      (redacted-mode (if redacted-mode -1 1)))))

8.21.31. smartparens

(eval-when-compile
  (el-get-bundle 'smartparens))

(with-delayed-execution
  (message "Install smartparens...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/smartparens"))
  (with-eval-after-load 'smartparens))

8.21.32. smart-jump

(eval-when-compile
  (el-get-bundle 'smart-jump))

(with-delayed-execution
  (message "Install smart-jump...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/smart-jump"))
  (with-eval-after-load 'smart-jump))

8.21.33. string-inflection

(eval-when-compile
  (el-get-bundle 'string-inflection
                 :url "https://github.com/akicho8/string-inflection.git"))

(with-delayed-execution
  (message "Install string-inflection...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/string-inflection"))
  (autoload-if-found '(string-inflection-all-cycle) "string-inflection" nil t))

8.21.34. subword

(with-delayed-execution
  (when (autoload-if-found '(my/delete-forward-block) "subword" nil t)
    (global-set-key (kbd "M-d") 'my/delete-forward-block)
    (defun my/delete-forward-block ()
      (interactive)
      (if (eobp)
          (message "End of buffer")
        (let* ((syntax-move-point
                (save-excursion
                  (skip-syntax-forward (string (char-syntax (char-after))))
                  (point)))
               (subword-move-point
                (save-excursion
                  (subword-forward)
                  (point))))
          (kill-region (point) (min syntax-move-point subword-move-point)))))))

8.21.35. tab-bar

(with-delayed-execution-priority-high
  (when (autoload-if-found '(tab-bar-mode tab-bar-history-mode) "tab-bar" nil t)
    (when (window-system)
      (tab-bar-mode 1)
      (tab-bar-history-mode 1))
    (global-set-key (kbd "C-x C-t") tab-prefix-map))

  (with-eval-after-load 'tab-bar
    (eval-and-compile
      (setq tab-bar-close-button-show nil)
      (setq tab-bar-close-last-tab-choice nil)
      (setq tab-bar-close-tab-select 'left)
      (setq tab-bar-history-mode nil)
      (setq tab-bar-new-tab-choice "*scratch*")
      (setq tab-bar-new-button-show nil)
      (setq tab-bar-tab-name-truncated-max 12)
      (setq tab-bar-separator " | ")))

  (with-eval-after-load 'ivy
    (defun my/advice-completing-read-to-ivy (orig-func &rest args)
      (interactive
       (let* ((recent-tabs (mapcar (lambda (tab)
                                     (alist-get 'name tab))
                                   (tab-bar--tabs-recent))))
         (list (ivy-completing-read "Switch to tab by name (default recent): "
                                    recent-tabs nil nil nil nil recent-tabs))))
      (apply orig-func args))
    (advice-add #'tab-bar-switch-to-tab :around #'my/advice-completing-read-to-ivy))

  (with-eval-after-load 'projectile
    (defun my/tab-bar-rename-tab ()
      (interactive)
      (let ((proj-name (projectile-project-name)))
        (tab-bar-rename-tab proj-name)))
    (define-key tab-prefix-map (kbd "r") #'my/tab-bar-rename-tab))

  (with-eval-after-load 'neotree
    (advice-add 'tab-new :before #'(lambda (&rest _) (neotree-hide)))
    (advice-add 'tab-next :before #'(lambda (&rest _) (neotree-hide)))
    (advice-add 'tab-bar-switch-to-tab :before #'(lambda (&rest _) (neotree-hide)))))

8.21.36. undo-tree

(eval-when-compile
  (el-get-bundle 'queue)
  (el-get-bundle 'undo-tree))

(with-delayed-execution
  (message "Install undo-tree...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/queue"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/undo-tree"))
  (when (autoload-if-found '(global-undo-tree-mode) "undo-tree" nil t)
    (require 'queue)
    (global-undo-tree-mode))
  (with-eval-after-load 'undo-tree
    (eval-and-compile
      (setq undo-tree-auto-save-history nil))))

8.21.37. uuid

(eval-when-compile
  (el-get-bundle 'uuid
                 :url "https://github.com/nicferrier/emacs-uuid.git"))

(with-delayed-execution
  (message "Install uuid...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/uuid"))
  (when (autoload-if-found '(my/uuid) "uuid" nil t)
    (defun my/uuid ()
      (interactive)
      (insert (uuid-string)))
    (defalias 'my/uuid 'uuid)))

8.21.38. view-lock-mode

(eval-when-compile
  (el-get-bundle 'view-lock-mode
                 :url "https://github.com/s-fubuki/view-lock-mode.git"))

(with-delayed-execution
  (message "Install view-lock-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/view-lock-mode"))
  (when (autoload-if-found '(view-lock-timer-setup) "view-lock-mode" nil t)
    (add-hook 'view-mode-hook #'view-lock-timer-setup)))

8.21.39. TODO wanderlust

;; (eval-when-compile
;;   (el-get-bundle 'wanderlust
;;                  :url "https://github.com/wanderlust/wanderlust.git"))

;; (with-delayed-execution
;;   (message "Install wanderlust...")
;;   (add-to-list 'load-path (locate-user-emacs-file "el-get/wanderlust"))
;;   (with-eval-after-load 'wanderlust
;;     (eval-and-compile
;;       (setq ssl-certificate-verification-policy 1))))

8.21.40. which-key

(eval-when-compile
  (el-get-bundle 'which-key))

(with-delayed-execution
  (message "Install which-key...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/which-key"))
  (when (autoload-if-found '(which-key-mode) "which-key" nil t)
    (which-key-mode)))

8.21.41. whitespace

(with-delayed-execution
  (when (autoload-if-found '(global-whitespace-mode) "whitespace" nil t)
    (add-hook 'emacs-startup-hook (lambda ()
                                    (if window-system
                                        (global-whitespace-mode 1)))))
  (with-eval-after-load 'whitespace
    (eval-and-compile
      (setq whitespace-style '(face tabs tab-mark spaces space-mark))
      (setq whitespace-display-mappings '((space-mark ?\u3000 [?\u25a1])
                                          (tab-mark ?\t [?\xBB ?\t] [?\\ ?\t]))))))

8.21.42. woman

(autoload 'woman
  "woman" "Decode and browse a UN*X man page." t)

(autoload 'woman-find-file "woman"
  "Find, decode and browse a specific UN*X man-page file." t)

8.21.43. writer-mode

(eval-when-compile
  (el-get-bundle 'visual-fill-column)
  (el-get-bundle 'writeroom-mode))

(with-delayed-execution
  (message "Install writeroom-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/visual-fill-column"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/writeroom-mode"))
  (when (autoload-if-found '(writeroom-mode
                             writeroom-mode-map
                             writeroom-decrease-width
                             writeroom-increase-width
                             writeroom-adjust-width
                             writeroom-width)
                           "writeroom-mode" nil t)
    (add-hook 'writeroom-mode-hook #'(lambda ()
                                       (linum-mode -1)
                                       (display-line-numbers-mode))))
  (with-eval-after-load 'writeroom-mode
    (eval-and-compile
      (setq writeroom-width 200))
    (define-key writeroom-mode-map (kbd "C-M-<") #'writeroom-decrease-width)
    (define-key writeroom-mode-map (kbd "C-M->") #'writeroom-increase-width)
    (define-key writeroom-mode-map (kbd "C-M-=") #'writeroom-adjust-width)))

8.21.44. zoom-window

(eval-when-compile
  (el-get-bundle 'zoom-window))

(with-delayed-execution
  (message "Install zoom-window...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/zoom-window"))
  (when (autoload-if-found '(zoom-window-zoom) "zoom-window" nil t)
    (global-set-key (kbd "C-x C-z") 'zoom-window-zoom)))

9. Elfeed

9.1. elfeed

(eval-when-compile
  (el-get-bundle 'elfeed))

(with-delayed-execution
  (message "Install elfeed...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/elfeed"))

  (defconst my/elfeed-search-filter "@1-week-ago +unread")

  (when (autoload-if-found '(elfeed) "elfeed" nil t)
    (global-set-key (kbd "C-x w") #'elfeed))

  (with-eval-after-load 'elfeed
    (eval-and-compile
      (setq elfeed-search-filter my/elfeed-search-filter)
      (setq browse-url-browser-function 'eww-browse-url)))

  (with-eval-after-load 'elfeed-curl
    (eval-and-compile
      (setq elfeed-curl-max-connections 8)))

  (with-eval-after-load 'ivy
    (defun my/elfeed-ivy-filter ()
      (interactive)
      (let ((filtered-tag (ivy-completing-read "Choose Tags: " (elfeed-db-get-all-tags))))
        (setq elfeed-search-filter (concat my/elfeed-search-filter " +" filtered-tag))
        (elfeed-search-update--force)))
    (define-key elfeed-search-mode-map (kbd "+") #'my/elfeed-ivy-filter)))

9.2. elfeed-org

(eval-when-compile
  (el-get-bundle 'elfeed-org))

(with-delayed-execution
  (message "Install elfeed-org...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/elfeed-org"))
  (when (autoload-if-found '(elfeed-org) "elfeed-org" nil t)
    (elfeed-org))
  (with-eval-after-load 'elfeed-org
    (eval-and-compile
      (setq rmh-elfeed-org-files '("~/.emacs.d/elfeed.org"))
      (setq rmh-elfeed-org-auto-ignore-invalid-feeds t))))

10. Eshell

10.1. basic

(with-eval-after-load 'eshell
  ;; my function
  (defun my/eshell-create (name)
    (interactive
     (let ((proj-name (projectile-project-name)))
       (concat "sName: " proj-name)))
    (eshell)
    (rename-buffer (concat "$" name)))
  (defalias 'eshell-create 'my/eshell-create)

  ;; shell function
  (defun eshell/ff (&rest args)
    (find-file (car args)))

  ;; config
  (defvar eshell-cmpl-ignore-case t)
  (defvar eshell-glob-include-dot-dot nil)
  (defvar eshell-ask-to-save-history (quote always))
  (defvar eshell-history-size 100000)
  (defvar eshell-hist-ignoredups t)


  ;; alias
  (defvar *shell-alias* '(("ll" "ls -la")
                          ("cdd" "cd ~/Desktop")))
  (defvar eshell-command-aliases-list (append *shell-alias*)))

10.2. eshell-z

(eval-when-compile
  (el-get-bundle xuchunyang/eshell-z))

(with-delayed-execution
  (message "Install eshell-z...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/eshell-z"))
  ;; (when (autoload-if-found '(eshell-z) "eshell-z" nil t)
  ;;   (define-key eshell-command-map (kbd "C-c C-q") 'eshell-z))
  )

10.3. TODO aweshell

;; (eval-when-compile
;;   (el-get-bundle 'aweshell
;;                  :url "https://github.com/takeokunn/aweshell.git"))

;; (with-delayed-execution
;;   (add-to-list 'load-path (locate-user-emacs-file "el-get/aweshell"))

;;   ;; (when (require 'eshell-did-you-mean)
;;   ;;   (eshell-did-you-mean-setup))

;;   ;; (when (require 'esh-opt)
;;   ;;   (autoload 'epe-theme-lambda "eshell-prompt-extras")
;;   ;;   (setq eshell-prompt-function 'epe-theme-lambda)
;;   ;;   (setq aweshell-auto-suggestion-p nil))

;;   ;; (when (require 'aweshell)
;;   ;;   (defun my/ivy-aweshell-history ()
;;   ;;     (interactive)
;;   ;;     (insert (ivy-read "Aweshell history: " (aweshell-parse-shell-history))))
;;   ;;   (define-key eshell-command-map (kbd "C-c C-r") 'my/ivy-aweshell-history))
;;   )

10.4. emacs-fish-completion

(eval-when-compile
  (el-get-bundle 'emacs-fish-completion
                 :url "https://github.com/Ambrevar/emacs-fish-completion.git"))

(with-delayed-execution
  (message "Install emacs-fish-completion")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/emacs-fish-completion"))
  (when (autoload-if-found '(global-fish-completion-mode) "fish-completion" nil t)
    (when (and (executable-find "fish"))
      (global-fish-completion-mode))))

11. Org Mode

11.1. basic

(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)

(with-eval-after-load 'org
  (define-key org-mode-map (kbd "C-c ,") 'org-insert-structure-template)
  (define-key org-mode-map (kbd "C-c C-,") 'org-insert-structure-template)
  (eval-and-compile
    (setq org-use-speed-commands t)
    (setq org-agenda-todo-ignore-with-date t)
    (setq org-directory "~/org")
    (setq org-agenda-files '("~/org/agenda"))
    (setq org-todo-keywords '((sequence "TODO(t)" "TODAY" "WAIT(w)" "|" "DONE(d)")))
    (setq org-capture-templates '(("t" "Todo" entry (file+datetree "~/org/todo.org")
                                   "* %?")
                                  ("m" "Memo" entry (file "~/org/memo.org")
                                   "* %?")))
    (setq org-startup-folded 'fold)
    (setq org-archive-location `,(format "~/org/archive/%s.org"
                                         (format-time-string "%Y" (current-time))))
    (setq org-link '(t (:foreground "#ebe087" :underline t)))))

11.2. org-id

(with-delayed-execution
  (message "Install org-id...")
  (autoload-if-found '(org-id-store-link) "org-id" nil t)
  (with-eval-after-load 'org-id
    (eval-and-compile
      (setq org-id-locations-file (expand-file-name ".org-id-locations" org-directory))
      (setq org-id-track-globally t)
      (setq org-id-extra-files (append org-agenda-text-search-extra-files))
      (setq org-id-link-to-org-use-id 'create-if-interactive))))

11.3. org-crypt

(with-delayed-execution
  (message "Install org-crypt...")
  (with-eval-after-load 'org-crypt
    (when (autoload-if-found '(org-encrypt-entry org-decrypt-entry org-crypt-use-before-save-magic) "org-crypt" nil t)
      (org-crypt-use-before-save-magic)
      (eval-and-compile
        (setq org-tags-exclude-from-inheritance '("crypt"))))))

11.4. org-babel

(eval-when-compile
  (el-get-bundle 'ob-fish :url "https://github.com/takeokunn/ob-fish.git")
  (el-get-bundle 'ob-go)
  (el-get-bundle 'ob-rust)
  (el-get-bundle 'ob-typescript))

(with-delayed-execution
  (message "Install ob-*...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ob-fish"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ob-go"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ob-rust"))
  (add-to-list 'load-path (locate-user-emacs-file "el-get/ob-typescript"))

  (with-eval-after-load 'ob-core
    (eval-and-compile
      (setq org-confirm-babel-evaluate nil)))

  (with-eval-after-load 'ob-babel
    (org-babel-do-load-languages 'org-babel-load-languages
                                 '((shell . t)
                                   (emacs-lisp . t)
                                   (lisp . t)
                                   (ruby . t)
                                   (fish . t)
                                   (go . t)
                                   (rust . t)
                                   (typescript . t)))))

11.5. org-journal

(eval-when-compile
  (el-get-bundle 'org-journal))

(with-delayed-execution
  (message "Install org-journal...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/org-journal"))
  (with-eval-after-load 'org-journal
    (eval-and-compile
      (setq org-journal-dir "~/org/journal")
      (setq org-journal-file-type 'weekly)
      (setq org-journal-prefix-key "C-c j"))))

11.6. org-superstar

(eval-when-compile
  (el-get-bundle 'org-superstar))

(with-delayed-execution-priority-high
  (add-to-list 'load-path (locate-user-emacs-file "el-get/org-superstar"))
  (when (autoload-if-found '(org-superstar-mode) "org-superstar")
    (add-hook 'org-mode-hook 'org-superstar-mode))
  (with-eval-after-load 'org-superstar
    (eval-and-compile
      (setq org-superstar-headline-bullets-list '("◉" "○" "✸" "✿"))
      (setq org-superstar-leading-bullet " "))))

11.7. org-generate

(eval-when-compile
  (el-get-bundle 'org-generate))

(with-delayed-execution
  (message "Install org-generate...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/org-generate"))
  (with-eval-after-load 'org-generate
    (eval-and-compile
      (setq org-generate-file `,(locate-user-emacs-file "yasnippets.org"))
      (setq org-generate-root "yasnippets"))))

11.8. org-pomodoro

(eval-when-compile
  (el-get-bundle "jwiegley/alert")
  (el-get-bundle 'org-pomodoro))

(with-delayed-execution
  (message "Install org-pomodoro...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/org-pomodoro"))
  (autoload-if-found '(org-pomodoro) "org-pomodoro" nil t))

11.9. org-view-mode

(eval-when-compile
  (el-get-bundle org-view-mode))

(with-delayed-execution
  (message "Install org-view-mode...")
  (add-to-list 'load-path (locate-user-emacs-file "el-get/org-view-mode"))
  ;; (when (autoload-if-found '() "org-view-mode" nil t)
  ;;   (with-eval-after-load 'org-view-mode))
  )

12. EAF

12.1. basic

;; (add-to-list 'load-path "~/.ghq/github.com/emacs-eaf/emacs-application-framework")
;; (require 'eaf)

;; (require 'eaf-demo)
;; (require 'eaf-file-sender)
;; (require 'eaf-music-player)
;; (require 'eaf-camera)
;; (require 'eaf-rss-reader)
;; (require 'eaf-terminal)
;; (require 'eaf-image-viewer)
;; (require 'eaf-pdf-viewer)
;; (require 'eaf-browser)
;; (require 'eaf-markdown-previewer)
;; (require 'eaf-file-browser)
;; (require 'eaf-mermaid)
;; (require 'eaf-file-manager)
;; (require 'eaf-mindmap)
;; (require 'eaf-video-player)
;; (require 'eaf-org-previewer)
;; (require 'eaf-airshare)
;; (require 'eaf-netease-cloud-music)
;; (require 'eaf-git)
;; (require 'eaf-system-monitor)

13. MyFunc

13.1. my/beginning-of-intendation

(defun my/beginning-of-intendation ()
  "move to beginning of line, or indentation"
  (interactive)
  (back-to-indentation))

13.2. my/before-set-auto-mode

(defun my/before-set-auto-mode ()
  (when (or (and buffer-file-name
                 (> (or (file-attribute-size (file-attributes buffer-file-name)) 0) 1000000))
            (> (line-number-at-pos (point-max)) 100000))
    (prog1 t
      (prog-mode))))

(advice-add 'set-auto-mode :before-until #'my/before-set-auto-mode)

13.3. my/copy-buffer

(defun my/copy-buffer ()
  (interactive)
  (save-excursion
    (mark-whole-buffer)
    (copy-region-as-kill (region-beginning) (region-end))))

(defalias 'copy-buffer 'my/copy-buffer)

13.4. my/ghq-get

(defun my/ghq-get ()
  (interactive)
  (let ((url (read-string "url > ")))
    (message
     (shell-command-to-string
      (mapconcat #'shell-quote-argument
                 (list "ghq" "get" url)
                 " ")))))

(defalias 'ghq-get 'my/ghq-get)

13.5. my/gh-browse

(defun my/gh-browse ()
  (interactive)
  (message
   (shell-command-to-string
    (mapconcat #'shell-quote-argument
               (list "gh" "browse")
               " "))))

(defalias 'gh-browse 'my/gh-browse)

13.6. my/indent-all

(defun my/indent-buffer ()
  (interactive)
  (save-excursion
    (mark-whole-buffer)
    (indent-region (region-beginning) (region-end))))

(defalias 'indent-buffer 'my/indent-buffer)

13.7. my/move-line

(defun my/move-line (arg)
  (interactive)
  (let ((col (current-column)))
    (unless (eq col 0)
      (move-to-column 0))
    (save-excursion
      (forward-line)
      (transpose-lines arg))
    (forward-line arg)))

(defun my/move-line-down ()
  (interactive)
  (my/move-line 1))

(defun my/move-line-up ()
  (interactive)
  (my/move-line -1))

(global-set-key (kbd "M-N") 'my/move-line-down)
(global-set-key (kbd "M-P") 'my/move-line-up)

13.8. my/reload-major-mode

(defun my/reload-major-mode ()
  "Reload current major mode."
  (interactive)
  (let ((current-mode major-mode))
    (fundamental-mode)
    (funcall current-mode)
    current-mode))

13.9. my/toggle-read-only-mode

(defun my/toggle-read-only-mode ()
  (interactive)
  (read-only-mode))

(global-set-key (kbd "C-x C-q") 'my/toggle-read-only-mode)

13.10. my/toggle-kill-emacs

(defvar my/kill-emacs-keybind-p t)

(defun my/toggle-kill-emacs ()
  (interactive)
  (if my/kill-emacs-keybind-p
      (progn
        (message "C-x C-c save-buffers-kill-emacs OFF")
        (setq my/kill-emacs-keybind-p nil)
        (global-set-key (kbd "C-x C-c") nil))
    (progn
      (message "C-x C-c save-buffers-kill-emacs ON")
      (setq my/kill-emacs-keybind-p t)
      (global-set-key (kbd "C-x C-c") 'save-buffers-kill-emacs))))

13.11. my/get-class-name-by-file-name

(defun my/get-class-name-by-file-name ()
  (interactive)
  (insert
   (file-name-nondirectory
    (file-name-sans-extension (or (buffer-file-name)
                                  (buffer-name (current-buffer)))))))

14. footer

14.1. Magic File Name を有効にする

(setq file-name-handler-alist my/saved-file-name-handler-alist)

14.2. profilerを終了する

(when my/enable-profile
  (profiler-report)
  (profiler-stop))

Author: takeokunn

Created: 2022-06-25 Sat 12:24

Validate