diff --git a/modules/feature/evil/autoload/evil.el b/modules/feature/evil/autoload/evil.el index 1da151300..8eb6638ea 100644 --- a/modules/feature/evil/autoload/evil.el +++ b/modules/feature/evil/autoload/evil.el @@ -13,7 +13,7 @@ ;; -;; Commands +;;; Commands ;;;###autoload (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) (evil-define-operator +evil:apply-macro (beg end) @@ -154,7 +154,8 @@ integration." (doom/clone-and-narrow-buffer beg end bang)) -;; --- custom arg handlers ---------------- +;; +;;; Custom arg handlers (defvar +evil--flag nil) @@ -241,7 +242,8 @@ the first match on each line)." -1 1 bang)) -;; --- wgrep ------------------------------ +;; +;;; wgrep ;;;###autoload (autoload '+evil-delete "feature/evil/autoload/evil" nil t) (evil-define-operator +evil-delete (beg end type register yank-handler) diff --git a/modules/lang/clojure/config.el b/modules/lang/clojure/config.el index ab6d8823b..e20a8ed9e 100644 --- a/modules/lang/clojure/config.el +++ b/modules/lang/clojure/config.el @@ -4,16 +4,11 @@ (after! clojure-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 ;; NOTE: if you don't have an org directory set (the dir doesn't exist), ;; cider jack in won't work. :commands (cider-jack-in cider-jack-in-clojurescript) - :hook (clojure-mode . cider-mode) + :hook (clojure-mode-local-vars . cider-mode) :init (set-repl-handler! 'clojure-mode #'+clojure/repl) (set-eval-handler! 'clojure-mode #'cider-eval-region) @@ -22,6 +17,11 @@ :documentation #'cider-doc) (add-hook 'cider-mode-hook #'eldoc-mode) :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 nrepl-log-messages nil cider-font-lock-dynamically '(macro core function var) diff --git a/modules/lang/coq/config.el b/modules/lang/coq/config.el index da7283ac6..8bfdcf90e 100644 --- a/modules/lang/coq/config.el +++ b/modules/lang/coq/config.el @@ -3,8 +3,11 @@ ;; `coq' (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 '()) + (after! company-coq (set-popup-rule! "^\\*\\(?:response\\|goals\\)\\*" :ignore t) (set-lookup-handlers! 'company-coq-mode diff --git a/modules/lang/elixir/config.el b/modules/lang/elixir/config.el index 718dd46e8..71c4973e0 100644 --- a/modules/lang/elixir/config.el +++ b/modules/lang/elixir/config.el @@ -3,20 +3,10 @@ (def-package! elixir-mode :defer t :init - ;; Disable default smartparens config; there are too many, they're intrusive - ;; and we only want a subset of them (defined below). + ;; Disable default smartparens config. There are too many pairs; we only want + ;; a subset of them (defined below). (provide 'smartparens-elixir) :config - ;; ...and only complete the basics - (after! smartparens - (sp-with-modes 'elixir-mode - (sp-local-pair "do" "end" - :when '(("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 ;; Functional :def "def" @@ -30,6 +20,16 @@ :for "for" :return "return" :yield "use") + ;; ...and only complete the basics + (after! smartparens + (sp-with-modes 'elixir-mode + (sp-local-pair "do" "end" + :when '(("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 :when (featurep! :completion company) :commands alchemist-company diff --git a/modules/lang/elm/config.el b/modules/lang/elm/config.el index 3899a89f9..b10dde8c1 100644 --- a/modules/lang/elm/config.el +++ b/modules/lang/elm/config.el @@ -5,6 +5,7 @@ (after! elm-mode (add-hook 'elm-mode-hook #'rainbow-delimiters-mode) + (set-company-backend! 'elm-mode 'company-elm) (set-repl-handler! 'elm-mode #'run-elm-interactive) (set-pretty-symbols! 'elm-mode @@ -22,4 +23,3 @@ :when (featurep! :tools flycheck) :after elm-mode :config (add-to-list 'flycheck-checkers 'elm nil #'eq)) - diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index 02579ba42..ff38736ec 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -42,7 +42,8 @@ (add-hook! 'emacs-lisp-mode-hook #'(;; 3rd-party functionality - auto-compile-on-save-mode outline-minor-mode + auto-compile-on-save-mode + outline-minor-mode ;; initialization +emacs-lisp|extend-imenu)) diff --git a/modules/lang/erlang/config.el b/modules/lang/erlang/config.el index fbc17bc31..ed91e5229 100644 --- a/modules/lang/erlang/config.el +++ b/modules/lang/erlang/config.el @@ -1,11 +1,9 @@ -;;; private/erlang/config.el -*- lexical-binding: t; -*- +;;; lang/erlang/config.el -*- lexical-binding: t; -*- -(dolist (regexp '("\\.erlang$" - ;; rebar files - "/rebar\\.config\\(?:\\.script\\)?$" - ;; erlang configs - "/\\(?:app\\|sys\\)\\.config$")) - (add-to-list 'auto-mode-alist (cons regexp 'erlang-mode))) +(def-package! erlang + :mode ("\\.erlang$" . erlang-mode) + :mode ("/rebar\\.config\\(?:\\.script\\)?$" . erlang-mode) + :mode ("/\\(?:app\\|sys\\)\\.config$" . erlang-mode)) (def-package! flycheck-rebar3 diff --git a/modules/lang/ess/config.el b/modules/lang/ess/config.el index 42d337541..249c9264a 100644 --- a/modules/lang/ess/config.el +++ b/modules/lang/ess/config.el @@ -9,6 +9,7 @@ :config (setq ess-offset-continued 'straight ess-expression-offset 2 + ess-use-flymake (not (featurep! :tools flycheck)) ess-nuke-trailing-whitespace-p t ess-default-style 'DEFAULT ess-history-directory (expand-file-name "ess-history/" doom-cache-dir)) diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index e64f7d753..c1093956a 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -3,9 +3,6 @@ (def-package! markdown-mode :mode ("/README\\(?:\\.\\(?:markdown\\|md\\)\\)?\\'" . gfm-mode) :init - (when (featurep! +pandoc) - (setq markdown-command "pandoc --from=markdown --to=html --standalone --mathjax --highlight-style=pygments")) - (setq markdown-enable-wiki-links t markdown-italic-underscore t markdown-asymmetric-header t @@ -17,7 +14,10 @@ markdown-gfm-uppercase-checkbox t) ; for compat with org-mode :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 () (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 #'auto-fill-mode) + (sp-with-modes '(markdown-mode gfm-mode) + (sp-local-pair "```" "```" :post-handlers '(:add ("||\n[i]" "RET")))) + (map! :map markdown-mode-map - [remap find-file-at-point] #'markdown-follow-thing-at-point "M-*" #'markdown-insert-list-item "M-b" #'markdown-insert-bold "M-i" #'markdown-insert-italic @@ -51,7 +53,9 @@ "i" #'markdown-insert-image "l" #'markdown-insert-link)))) + (def-package! pandoc-mode :when (featurep! +pandoc) :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")) diff --git a/modules/tools/flyspell/autoload.el b/modules/tools/flyspell/autoload.el index 139b98061..be7e25e1c 100644 --- a/modules/tools/flyspell/autoload.el +++ b/modules/tools/flyspell/autoload.el @@ -6,6 +6,7 @@ ;;;###autodef (defun set-flyspell-predicate! (modes predicate) "TODO" + (declare (indent defun)) (dolist (mode (doom-enlist modes) +flyspell--predicate-alist) (add-to-list '+flyspell--predicate-alist (cons mode predicate)))) diff --git a/modules/tools/flyspell/config.el b/modules/tools/flyspell/config.el index ab3030bcc..b80c0e54b 100644 --- a/modules/tools/flyspell/config.el +++ b/modules/tools/flyspell/config.el @@ -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")) (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") (setq ispell-program-name "hunspell" @@ -35,15 +43,7 @@ Since spellchecking can be slow in some buffers, this can be disabled with: nil utf-8))))) - (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)) + (add-to-list 'ispell-extra-args "--dont-tex-check-comments")) ;; `flyspell' (built-in) diff --git a/modules/tools/flyspell/doctor.el b/modules/tools/flyspell/doctor.el new file mode 100644 index 000000000..9d1cb3286 --- /dev/null +++ b/modules/tools/flyspell/doctor.el @@ -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.")) diff --git a/modules/tools/pdf/config.el b/modules/tools/pdf/config.el index a10e9a5e3..2f22d3983 100644 --- a/modules/tools/pdf/config.el +++ b/modules/tools/pdf/config.el @@ -6,12 +6,7 @@ (unless noninteractive (pdf-tools-install)) - (define-key! pdf-view-mode-map - "q" #'kill-this-buffer) - - (when (featurep! :feature evil +everywhere) - (evil-define-key* 'normal pdf-view-mode-map - "q" #'kill-this-buffer)) + (map! :map pdf-view-mode-map :gn "q" #'kill-this-buffer) (defun +pdf|cleanup-windows () "Kill left-over annotation buffers when the document is killed." diff --git a/modules/ui/modeline/autoload.el b/modules/ui/modeline/autoload.el index 0c0a8a955..9994e6f8a 100644 --- a/modules/ui/modeline/autoload.el +++ b/modules/ui/modeline/autoload.el @@ -29,7 +29,7 @@ made to be added to `doom-big-font-mode-hook'." ;;;###autoload (defun +modeline|update-env-in-all-windows (&rest _) - "" + "TODO" (dolist (window (window-list)) (with-selected-window window (doom-modeline-update-env))))