General module refactor
This commit is contained in:
parent
0bd576673c
commit
7c9e96da87
14 changed files with 63 additions and 54 deletions
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Commands
|
;;; Commands
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +evil/visual-indent ()
|
(defun +evil/visual-indent ()
|
||||||
|
@ -111,7 +111,7 @@ integration."
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Evil commands/operators
|
;;; Evil commands/operators
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:apply-macro "feature/evil/autoload/evil" nil t)
|
;;;###autoload (autoload '+evil:apply-macro "feature/evil/autoload/evil" nil t)
|
||||||
(evil-define-operator +evil:apply-macro (beg end)
|
(evil-define-operator +evil:apply-macro (beg end)
|
||||||
|
@ -154,7 +154,8 @@ integration."
|
||||||
(doom/clone-and-narrow-buffer beg end bang))
|
(doom/clone-and-narrow-buffer beg end bang))
|
||||||
|
|
||||||
|
|
||||||
;; --- custom arg handlers ----------------
|
;;
|
||||||
|
;;; Custom arg handlers
|
||||||
|
|
||||||
(defvar +evil--flag nil)
|
(defvar +evil--flag nil)
|
||||||
|
|
||||||
|
@ -241,7 +242,8 @@ the first match on each line)."
|
||||||
-1 1 bang))
|
-1 1 bang))
|
||||||
|
|
||||||
|
|
||||||
;; --- wgrep ------------------------------
|
;;
|
||||||
|
;;; wgrep
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil-delete "feature/evil/autoload/evil" nil t)
|
;;;###autoload (autoload '+evil-delete "feature/evil/autoload/evil" nil t)
|
||||||
(evil-define-operator +evil-delete (beg end type register yank-handler)
|
(evil-define-operator +evil-delete (beg end type register yank-handler)
|
||||||
|
|
|
@ -4,16 +4,11 @@
|
||||||
(after! clojure-mode
|
(after! clojure-mode
|
||||||
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
||||||
|
|
||||||
(set-popup-rules!
|
|
||||||
'(("^\\*cider-error*" :ignore t)
|
|
||||||
("^\\*cider-repl" :quit nil)
|
|
||||||
("^\\*cider-repl-history" :vslot 2 :ttl nil)))
|
|
||||||
|
|
||||||
(def-package! cider
|
(def-package! cider
|
||||||
;; NOTE: if you don't have an org directory set (the dir doesn't exist),
|
;; NOTE: if you don't have an org directory set (the dir doesn't exist),
|
||||||
;; cider jack in won't work.
|
;; cider jack in won't work.
|
||||||
:commands (cider-jack-in cider-jack-in-clojurescript)
|
:commands (cider-jack-in cider-jack-in-clojurescript)
|
||||||
:hook (clojure-mode . cider-mode)
|
:hook (clojure-mode-local-vars . cider-mode)
|
||||||
:init
|
:init
|
||||||
(set-repl-handler! 'clojure-mode #'+clojure/repl)
|
(set-repl-handler! 'clojure-mode #'+clojure/repl)
|
||||||
(set-eval-handler! 'clojure-mode #'cider-eval-region)
|
(set-eval-handler! 'clojure-mode #'cider-eval-region)
|
||||||
|
@ -22,6 +17,11 @@
|
||||||
:documentation #'cider-doc)
|
:documentation #'cider-doc)
|
||||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||||
:config
|
:config
|
||||||
|
(set-popup-rules!
|
||||||
|
'(("^\\*cider-error*" :ignore t)
|
||||||
|
("^\\*cider-repl" :quit nil)
|
||||||
|
("^\\*cider-repl-history" :vslot 2 :ttl nil)))
|
||||||
|
|
||||||
(setq nrepl-hide-special-buffers t
|
(setq nrepl-hide-special-buffers t
|
||||||
nrepl-log-messages nil
|
nrepl-log-messages nil
|
||||||
cider-font-lock-dynamically '(macro core function var)
|
cider-font-lock-dynamically '(macro core function var)
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
;; `coq'
|
;; `coq'
|
||||||
(setq proof-electric-terminator-enable t)
|
(setq proof-electric-terminator-enable t)
|
||||||
|
|
||||||
|
;; We've replaced coq-mode abbrevs with yasnippet snippets (in the snippets
|
||||||
|
;; library included with Doom).
|
||||||
(setq coq-mode-abbrev-table '())
|
(setq coq-mode-abbrev-table '())
|
||||||
|
|
||||||
|
|
||||||
(after! company-coq
|
(after! company-coq
|
||||||
(set-popup-rule! "^\\*\\(?:response\\|goals\\)\\*" :ignore t)
|
(set-popup-rule! "^\\*\\(?:response\\|goals\\)\\*" :ignore t)
|
||||||
(set-lookup-handlers! 'company-coq-mode
|
(set-lookup-handlers! 'company-coq-mode
|
||||||
|
|
|
@ -3,20 +3,10 @@
|
||||||
(def-package! elixir-mode
|
(def-package! elixir-mode
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
;; Disable default smartparens config; there are too many, they're intrusive
|
;; Disable default smartparens config. There are too many pairs; we only want
|
||||||
;; and we only want a subset of them (defined below).
|
;; a subset of them (defined below).
|
||||||
(provide 'smartparens-elixir)
|
(provide 'smartparens-elixir)
|
||||||
:config
|
:config
|
||||||
;; ...and only complete the basics
|
|
||||||
(after! smartparens
|
|
||||||
(sp-with-modes 'elixir-mode
|
|
||||||
(sp-local-pair "do" "end"
|
|
||||||
:when '(("RET" "<evil-ret>"))
|
|
||||||
:unless '(sp-in-comment-p sp-in-string-p)
|
|
||||||
:post-handlers '("||\n[i]"))
|
|
||||||
(sp-local-pair "do " " end" :unless '(sp-in-comment-p sp-in-string-p))
|
|
||||||
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p))))
|
|
||||||
|
|
||||||
(set-pretty-symbols! 'elixir-mode
|
(set-pretty-symbols! 'elixir-mode
|
||||||
;; Functional
|
;; Functional
|
||||||
:def "def"
|
:def "def"
|
||||||
|
@ -30,6 +20,16 @@
|
||||||
:for "for"
|
:for "for"
|
||||||
:return "return" :yield "use")
|
:return "return" :yield "use")
|
||||||
|
|
||||||
|
;; ...and only complete the basics
|
||||||
|
(after! smartparens
|
||||||
|
(sp-with-modes 'elixir-mode
|
||||||
|
(sp-local-pair "do" "end"
|
||||||
|
:when '(("RET" "<evil-ret>"))
|
||||||
|
:unless '(sp-in-comment-p sp-in-string-p)
|
||||||
|
:post-handlers '("||\n[i]"))
|
||||||
|
(sp-local-pair "do " " end" :unless '(sp-in-comment-p sp-in-string-p))
|
||||||
|
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p))))
|
||||||
|
|
||||||
(def-package! alchemist-company
|
(def-package! alchemist-company
|
||||||
:when (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
:commands alchemist-company
|
:commands alchemist-company
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
(after! elm-mode
|
(after! elm-mode
|
||||||
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
||||||
|
|
||||||
(set-company-backend! 'elm-mode 'company-elm)
|
(set-company-backend! 'elm-mode 'company-elm)
|
||||||
(set-repl-handler! 'elm-mode #'run-elm-interactive)
|
(set-repl-handler! 'elm-mode #'run-elm-interactive)
|
||||||
(set-pretty-symbols! 'elm-mode
|
(set-pretty-symbols! 'elm-mode
|
||||||
|
@ -22,4 +23,3 @@
|
||||||
:when (featurep! :tools flycheck)
|
:when (featurep! :tools flycheck)
|
||||||
:after elm-mode
|
:after elm-mode
|
||||||
:config (add-to-list 'flycheck-checkers 'elm nil #'eq))
|
:config (add-to-list 'flycheck-checkers 'elm nil #'eq))
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@
|
||||||
|
|
||||||
(add-hook! 'emacs-lisp-mode-hook
|
(add-hook! 'emacs-lisp-mode-hook
|
||||||
#'(;; 3rd-party functionality
|
#'(;; 3rd-party functionality
|
||||||
auto-compile-on-save-mode outline-minor-mode
|
auto-compile-on-save-mode
|
||||||
|
outline-minor-mode
|
||||||
;; initialization
|
;; initialization
|
||||||
+emacs-lisp|extend-imenu))
|
+emacs-lisp|extend-imenu))
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
;;; private/erlang/config.el -*- lexical-binding: t; -*-
|
;;; lang/erlang/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(dolist (regexp '("\\.erlang$"
|
(def-package! erlang
|
||||||
;; rebar files
|
:mode ("\\.erlang$" . erlang-mode)
|
||||||
"/rebar\\.config\\(?:\\.script\\)?$"
|
:mode ("/rebar\\.config\\(?:\\.script\\)?$" . erlang-mode)
|
||||||
;; erlang configs
|
:mode ("/\\(?:app\\|sys\\)\\.config$" . erlang-mode))
|
||||||
"/\\(?:app\\|sys\\)\\.config$"))
|
|
||||||
(add-to-list 'auto-mode-alist (cons regexp 'erlang-mode)))
|
|
||||||
|
|
||||||
|
|
||||||
(def-package! flycheck-rebar3
|
(def-package! flycheck-rebar3
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
:config
|
:config
|
||||||
(setq ess-offset-continued 'straight
|
(setq ess-offset-continued 'straight
|
||||||
ess-expression-offset 2
|
ess-expression-offset 2
|
||||||
|
ess-use-flymake (not (featurep! :tools flycheck))
|
||||||
ess-nuke-trailing-whitespace-p t
|
ess-nuke-trailing-whitespace-p t
|
||||||
ess-default-style 'DEFAULT
|
ess-default-style 'DEFAULT
|
||||||
ess-history-directory (expand-file-name "ess-history/" doom-cache-dir))
|
ess-history-directory (expand-file-name "ess-history/" doom-cache-dir))
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
(def-package! markdown-mode
|
(def-package! markdown-mode
|
||||||
:mode ("/README\\(?:\\.\\(?:markdown\\|md\\)\\)?\\'" . gfm-mode)
|
:mode ("/README\\(?:\\.\\(?:markdown\\|md\\)\\)?\\'" . gfm-mode)
|
||||||
:init
|
:init
|
||||||
(when (featurep! +pandoc)
|
|
||||||
(setq markdown-command "pandoc --from=markdown --to=html --standalone --mathjax --highlight-style=pygments"))
|
|
||||||
|
|
||||||
(setq markdown-enable-wiki-links t
|
(setq markdown-enable-wiki-links t
|
||||||
markdown-italic-underscore t
|
markdown-italic-underscore t
|
||||||
markdown-asymmetric-header t
|
markdown-asymmetric-header t
|
||||||
|
@ -17,7 +14,10 @@
|
||||||
markdown-gfm-uppercase-checkbox t) ; for compat with org-mode
|
markdown-gfm-uppercase-checkbox t) ; for compat with org-mode
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(set-flyspell-predicate! '(markdown-mode gfm-mode) #'+markdown-flyspell-word-p)
|
(set-flyspell-predicate! '(markdown-mode gfm-mode)
|
||||||
|
#'+markdown-flyspell-word-p)
|
||||||
|
(set-lookup-handlers! '(markdown-mode gfm-mode)
|
||||||
|
:file #'markdown-follow-thing-at-point)
|
||||||
|
|
||||||
(defun +markdown|set-fill-column-and-line-spacing ()
|
(defun +markdown|set-fill-column-and-line-spacing ()
|
||||||
(setq-local line-spacing 2)
|
(setq-local line-spacing 2)
|
||||||
|
@ -25,8 +25,10 @@
|
||||||
(add-hook 'markdown-mode-hook #'+markdown|set-fill-column-and-line-spacing)
|
(add-hook 'markdown-mode-hook #'+markdown|set-fill-column-and-line-spacing)
|
||||||
(add-hook 'markdown-mode-hook #'auto-fill-mode)
|
(add-hook 'markdown-mode-hook #'auto-fill-mode)
|
||||||
|
|
||||||
|
(sp-with-modes '(markdown-mode gfm-mode)
|
||||||
|
(sp-local-pair "```" "```" :post-handlers '(:add ("||\n[i]" "RET"))))
|
||||||
|
|
||||||
(map! :map markdown-mode-map
|
(map! :map markdown-mode-map
|
||||||
[remap find-file-at-point] #'markdown-follow-thing-at-point
|
|
||||||
"M-*" #'markdown-insert-list-item
|
"M-*" #'markdown-insert-list-item
|
||||||
"M-b" #'markdown-insert-bold
|
"M-b" #'markdown-insert-bold
|
||||||
"M-i" #'markdown-insert-italic
|
"M-i" #'markdown-insert-italic
|
||||||
|
@ -51,7 +53,9 @@
|
||||||
"i" #'markdown-insert-image
|
"i" #'markdown-insert-image
|
||||||
"l" #'markdown-insert-link))))
|
"l" #'markdown-insert-link))))
|
||||||
|
|
||||||
|
|
||||||
(def-package! pandoc-mode
|
(def-package! pandoc-mode
|
||||||
:when (featurep! +pandoc)
|
:when (featurep! +pandoc)
|
||||||
:commands pandoc-mode
|
:commands pandoc-mode
|
||||||
:hook (markdown-mode . conditionally-turn-on-pandoc))
|
:hook (markdown-mode . conditionally-turn-on-pandoc)
|
||||||
|
:init (setq markdown-command "pandoc --from=markdown --to=html --standalone --mathjax --highlight-style=pygments"))
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
;;;###autodef
|
;;;###autodef
|
||||||
(defun set-flyspell-predicate! (modes predicate)
|
(defun set-flyspell-predicate! (modes predicate)
|
||||||
"TODO"
|
"TODO"
|
||||||
|
(declare (indent defun))
|
||||||
(dolist (mode (doom-enlist modes) +flyspell--predicate-alist)
|
(dolist (mode (doom-enlist modes) +flyspell--predicate-alist)
|
||||||
(add-to-list '+flyspell--predicate-alist (cons mode predicate))))
|
(add-to-list '+flyspell--predicate-alist (cons mode predicate))))
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,15 @@ Since spellchecking can be slow in some buffers, this can be disabled with:
|
||||||
ispell-extra-args '("--sug-mode=ultra" "--run-together"))
|
ispell-extra-args '("--sug-mode=ultra" "--run-together"))
|
||||||
|
|
||||||
(setq-hook! 'text-mode-hook
|
(setq-hook! 'text-mode-hook
|
||||||
ispell-extra-args (remove "--run-together" ispell-extra-args)))
|
ispell-extra-args (remove "--run-together" ispell-extra-args))
|
||||||
|
|
||||||
|
(defun +flyspell*setup-ispell-extra-args (orig-fun &rest args)
|
||||||
|
(let ((ispell-extra-args (remove "--run-together" ispell-extra-args)))
|
||||||
|
(ispell-kill-ispell t)
|
||||||
|
(apply orig-fun args)
|
||||||
|
(ispell-kill-ispell t)))
|
||||||
|
(advice-add #'ispell-word :around #'+flyspell*setup-ispell-extra-args)
|
||||||
|
(advice-add #'flyspell-auto-correct-word :around #'+flyspell*setup-ispell-extra-args))
|
||||||
|
|
||||||
((executable-find "hunspell")
|
((executable-find "hunspell")
|
||||||
(setq ispell-program-name "hunspell"
|
(setq ispell-program-name "hunspell"
|
||||||
|
@ -35,15 +43,7 @@ Since spellchecking can be slow in some buffers, this can be disabled with:
|
||||||
nil
|
nil
|
||||||
utf-8)))))
|
utf-8)))))
|
||||||
|
|
||||||
(add-to-list 'ispell-extra-args "--dont-tex-check-comments")
|
(add-to-list 'ispell-extra-args "--dont-tex-check-comments"))
|
||||||
|
|
||||||
(defun +flyspell*setup-ispell-extra-args (orig-fun &rest args)
|
|
||||||
(let ((ispell-extra-args (remove "--run-together" ispell-extra-args)))
|
|
||||||
(ispell-kill-ispell t)
|
|
||||||
(apply orig-fun args)
|
|
||||||
(ispell-kill-ispell t)))
|
|
||||||
(advice-add #'ispell-word :around #'+flyspell*setup-ispell-extra-args)
|
|
||||||
(advice-add #'flyspell-auto-correct-word :around #'+flyspell*setup-ispell-extra-args))
|
|
||||||
|
|
||||||
|
|
||||||
;; `flyspell' (built-in)
|
;; `flyspell' (built-in)
|
||||||
|
|
4
modules/tools/flyspell/doctor.el
Normal file
4
modules/tools/flyspell/doctor.el
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
(unless (or (executable-find "aspell")
|
||||||
|
(executable-find "hunspell"))
|
||||||
|
(warn! "Could not find aspell or hunspell. Flyspell will fall back to ispell, which may not work."))
|
|
@ -6,12 +6,7 @@
|
||||||
(unless noninteractive
|
(unless noninteractive
|
||||||
(pdf-tools-install))
|
(pdf-tools-install))
|
||||||
|
|
||||||
(define-key! pdf-view-mode-map
|
(map! :map pdf-view-mode-map :gn "q" #'kill-this-buffer)
|
||||||
"q" #'kill-this-buffer)
|
|
||||||
|
|
||||||
(when (featurep! :feature evil +everywhere)
|
|
||||||
(evil-define-key* 'normal pdf-view-mode-map
|
|
||||||
"q" #'kill-this-buffer))
|
|
||||||
|
|
||||||
(defun +pdf|cleanup-windows ()
|
(defun +pdf|cleanup-windows ()
|
||||||
"Kill left-over annotation buffers when the document is killed."
|
"Kill left-over annotation buffers when the document is killed."
|
||||||
|
|
|
@ -29,7 +29,7 @@ made to be added to `doom-big-font-mode-hook'."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +modeline|update-env-in-all-windows (&rest _)
|
(defun +modeline|update-env-in-all-windows (&rest _)
|
||||||
""
|
"TODO"
|
||||||
(dolist (window (window-list))
|
(dolist (window (window-list))
|
||||||
(with-selected-window window
|
(with-selected-window window
|
||||||
(doom-modeline-update-env))))
|
(doom-modeline-update-env))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue