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
|
||||
(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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" "<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
|
||||
;; 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" "<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
|
||||
:when (featurep! :completion company)
|
||||
:commands alchemist-company
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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))))
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
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
|
||||
(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."
|
||||
|
|
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue