General refactor & cleanup, across the board
This commit is contained in:
parent
4ddc5c194b
commit
2d365619cd
35 changed files with 141 additions and 155 deletions
|
@ -669,7 +669,7 @@ startup (or theme switch) time, so long as `doom--prefer-theme-elc' is non-nil."
|
||||||
|
|
||||||
;; doesn't exist in terminal Emacs; we define it to prevent errors
|
;; doesn't exist in terminal Emacs; we define it to prevent errors
|
||||||
(unless (fboundp 'define-fringe-bitmap)
|
(unless (fboundp 'define-fringe-bitmap)
|
||||||
(defun define-fringe-bitmap (&rest _)))
|
(fset 'define-fringe-bitmap #'ignore))
|
||||||
|
|
||||||
(after! whitespace
|
(after! whitespace
|
||||||
(defun doom-disable-whitespace-mode-in-childframes-a (orig-fn)
|
(defun doom-disable-whitespace-mode-in-childframes-a (orig-fn)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
;;; config/default/+evil.el -*- lexical-binding: t; -*-
|
;;; config/default/+evil.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defun +default|disable-delete-selection-mode ()
|
(defun +default-disable-delete-selection-mode-h ()
|
||||||
(delete-selection-mode -1))
|
(delete-selection-mode -1))
|
||||||
(add-hook 'evil-insert-state-entry-hook #'delete-selection-mode)
|
(add-hook 'evil-insert-state-entry-hook #'delete-selection-mode)
|
||||||
(add-hook 'evil-insert-state-exit-hook #'+default|disable-delete-selection-mode)
|
(add-hook 'evil-insert-state-exit-hook #'+default-disable-delete-selection-mode-h)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -109,7 +109,7 @@ If ARG (universal argument), runs `compile' from the current directory."
|
||||||
((error "No kill-ring search backend available. Enable ivy or helm!")))))
|
((error "No kill-ring search backend available. Enable ivy or helm!")))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default*newline-indent-and-continue-comments ()
|
(defun +default--newline-indent-and-continue-comments-a ()
|
||||||
"A replacement for `newline-and-indent'.
|
"A replacement for `newline-and-indent'.
|
||||||
|
|
||||||
Continues comments if executed from a commented line, with special support for
|
Continues comments if executed from a commented line, with special support for
|
||||||
|
@ -159,7 +159,7 @@ possible, or just one char if that's not possible."
|
||||||
((delete-char -1)))))
|
((delete-char -1)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default*delete-backward-char (n &optional killflag)
|
(defun +default--delete-backward-char-a (n &optional killflag)
|
||||||
"Same as `delete-backward-char', but preforms these additional checks:
|
"Same as `delete-backward-char', but preforms these additional checks:
|
||||||
|
|
||||||
+ If point is surrounded by (balanced) whitespace and a brace delimiter ({} []
|
+ If point is surrounded by (balanced) whitespace and a brace delimiter ({} []
|
||||||
|
|
|
@ -195,10 +195,10 @@
|
||||||
;; e) properly delete smartparen pairs when they are encountered, without
|
;; e) properly delete smartparen pairs when they are encountered, without
|
||||||
;; the need for strict mode.
|
;; the need for strict mode.
|
||||||
;; f) do none of this when inside a string
|
;; f) do none of this when inside a string
|
||||||
(advice-add #'delete-backward-char :override #'+default*delete-backward-char))
|
(advice-add #'delete-backward-char :override #'+default--delete-backward-char-a))
|
||||||
|
|
||||||
;; Makes `newline-and-indent' continue comments (and more reliably)
|
;; Makes `newline-and-indent' continue comments (and more reliably)
|
||||||
(advice-add #'newline-and-indent :override #'+default*newline-indent-and-continue-comments))
|
(advice-add #'newline-and-indent :override #'+default--newline-indent-and-continue-comments-a))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
(after! helm (helm-migemo-mode +1)))))
|
(after! helm (helm-migemo-mode +1)))))
|
||||||
|
|
||||||
|
|
||||||
(use-package pangu-spacing
|
(use-package! pangu-spacing
|
||||||
:hook (text-mode . pangu-spacing-mode)
|
:hook (text-mode . pangu-spacing-mode)
|
||||||
:init
|
:init
|
||||||
;; replacing `chinese-two-byte' by `japanese'
|
;; replacing `chinese-two-byte' by `japanese'
|
||||||
|
|
|
@ -56,9 +56,10 @@
|
||||||
"b" #'omnisharp-unit-test-buffer)))
|
"b" #'omnisharp-unit-test-buffer)))
|
||||||
|
|
||||||
|
|
||||||
|
;;;###package shader-mode
|
||||||
(when (featurep! +unity)
|
(when (featurep! +unity)
|
||||||
;; `shader-mode' --- unity shaders
|
;; Unity shaders
|
||||||
(add-to-list 'auto-mode-alist '("\\.shader$" . shader-mode))
|
(add-to-list 'auto-mode-alist '("\\.shader\\'" . shader-mode))
|
||||||
|
|
||||||
(def-project-mode! +csharp-unity-mode
|
(def-project-mode! +csharp-unity-mode
|
||||||
:modes '(csharp-mode shader-mode)
|
:modes '(csharp-mode shader-mode)
|
||||||
|
|
|
@ -32,18 +32,6 @@
|
||||||
(when (featurep! +lsp)
|
(when (featurep! +lsp)
|
||||||
(add-hook 'elixir-mode-local-vars-hook #'lsp!))
|
(add-hook 'elixir-mode-local-vars-hook #'lsp!))
|
||||||
|
|
||||||
(use-package! alchemist-company
|
|
||||||
:when (featurep! :completion company)
|
|
||||||
:commands alchemist-company
|
|
||||||
:init
|
|
||||||
(set-company-backend! 'elixir-mode '(alchemist-company company-yasnippet))
|
|
||||||
:config
|
|
||||||
;; Alchemist doesn't use hook symbols to add these backends, so we have to
|
|
||||||
;; use the entire closure to get rid of it.
|
|
||||||
(let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company)))))
|
|
||||||
(remove-hook 'alchemist-mode-hook fn)
|
|
||||||
(remove-hook 'alchemist-iex-mode-hook fn)))
|
|
||||||
|
|
||||||
(use-package! flycheck-credo
|
(use-package! flycheck-credo
|
||||||
:when (featurep! :tools flycheck)
|
:when (featurep! :tools flycheck)
|
||||||
:config (flycheck-credo-setup)))
|
:config (flycheck-credo-setup)))
|
||||||
|
@ -51,9 +39,24 @@
|
||||||
|
|
||||||
(use-package! alchemist
|
(use-package! alchemist
|
||||||
:hook (elixir-mode . alchemist-mode)
|
:hook (elixir-mode . alchemist-mode)
|
||||||
:config
|
:init
|
||||||
|
(after! elixir-mode
|
||||||
(set-lookup-handlers! 'elixir-mode
|
(set-lookup-handlers! 'elixir-mode
|
||||||
:definition #'alchemist-goto-definition-at-point
|
:definition #'alchemist-goto-definition-at-point
|
||||||
:documentation #'alchemist-help-search-at-point)
|
:documentation #'alchemist-help-search-at-point)
|
||||||
(set-eval-handler! 'elixir-mode #'alchemist-eval-region)
|
(set-eval-handler! 'elixir-mode #'alchemist-eval-region)
|
||||||
(set-repl-handler! 'elixir-mode #'alchemist-iex-project-run))
|
(set-repl-handler! 'elixir-mode #'alchemist-iex-project-run)))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! alchemist-company
|
||||||
|
:when (featurep! :completion company)
|
||||||
|
:commands alchemist-company
|
||||||
|
:init
|
||||||
|
(after! elixir-mode
|
||||||
|
(set-company-backend! 'elixir-mode '(alchemist-company company-yasnippet)))
|
||||||
|
:config
|
||||||
|
;; Alchemist doesn't use hook symbols to add these backends, so we have to use
|
||||||
|
;; the entire closure to get rid of it.
|
||||||
|
(let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company)))))
|
||||||
|
(remove-hook 'alchemist-mode-hook fn)
|
||||||
|
(remove-hook 'alchemist-iex-mode-hook fn)))
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
;;; lang/elm/config.el -*- lexical-binding: t; -*-
|
;;; lang/elm/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; `elm-mode'
|
|
||||||
(setq elm-format-on-save t)
|
|
||||||
|
|
||||||
(after! elm-mode
|
(after! elm-mode
|
||||||
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
;;; lang/erlang/config.el -*- lexical-binding: t; -*-
|
;;; lang/erlang/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package! erlang
|
(use-package! erlang
|
||||||
:mode ("\\.erlang$" . erlang-mode)
|
:mode ("\\.erlang\\'" . erlang-mode)
|
||||||
:mode ("/rebar\\.config\\(?:\\.script\\)?$" . erlang-mode)
|
:mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
|
||||||
:mode ("/\\(?:app\\|sys\\)\\.config$" . erlang-mode))
|
:mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode))
|
||||||
|
|
||||||
|
|
||||||
(use-package! flycheck-rebar3
|
(use-package! flycheck-rebar3
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;; lang/go/config.el -*- lexical-binding: t; -*-
|
;;; lang/go/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Packages
|
;;; Packages
|
||||||
|
|
||||||
(after! go-mode
|
(after! go-mode
|
||||||
(set-docsets! 'go-mode "Go")
|
(set-docsets! 'go-mode "Go")
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
|
|
||||||
|
|
||||||
(use-package! company-go
|
(use-package! company-go
|
||||||
:when (and (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
(not (featurep! +lsp)))
|
:unless (featurep! +lsp)
|
||||||
:after go-mode
|
:after go-mode
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'go-mode 'company-go)
|
(set-company-backend! 'go-mode 'company-go)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; lang/julia/config.el -*- lexical-binding: t; -*-
|
;;; lang/julia/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package julia-mode
|
(use-package! julia-mode
|
||||||
:interpreter "julia"
|
:interpreter "julia"
|
||||||
:config
|
:config
|
||||||
(set-repl-handler! 'julia-mode #'+julia/repl)
|
(set-repl-handler! 'julia-mode #'+julia/repl)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
:desc "gradlew build" "b" (λ! (+kotlin/run-gradlew "build"))
|
:desc "gradlew build" "b" (λ! (+kotlin/run-gradlew "build"))
|
||||||
:desc "gradlew test" "t" (λ! (+kotlin/run-gradlew "test"))))
|
:desc "gradlew test" "t" (λ! (+kotlin/run-gradlew "test"))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! flycheck-kotlin
|
(use-package! flycheck-kotlin
|
||||||
:when (featurep! :tools flycheck)
|
:when (featurep! :tools flycheck)
|
||||||
:after kotlin-mode
|
:hook (kotlin-mode . flycheck-kotlin-setup))
|
||||||
:config (add-hook 'kotlin-mode-hook #'flycheck-kotlin-setup))
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
;;; lang/ledger/config.el -*- lexical-binding: t; -*-
|
;;; lang/ledger/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; `ledger-mode'
|
;;;###package ledger-mode
|
||||||
(setq ledger-clear-whole-transactions 1)
|
(setq ledger-clear-whole-transactions 1)
|
||||||
|
|
||||||
(defun +ledger*check-version (orig-fn)
|
(defadvice! +ledger--check-version-a (orig-fn)
|
||||||
"Fail gracefully if ledger binary isn't available."
|
"Fail gracefully if ledger binary isn't available."
|
||||||
|
:around #'ledger-check-version
|
||||||
(if (executable-find ledger-binary-path)
|
(if (executable-find ledger-binary-path)
|
||||||
(funcall orig-fn)
|
(funcall orig-fn)
|
||||||
(message "Couldn't find '%s' executable" ledger-binary-path)))
|
(message "Couldn't find '%s' executable" ledger-binary-path)))
|
||||||
(advice-add #'ledger-check-version :around #'+ledger*check-version)
|
|
||||||
|
|
||||||
;; Restore leader key in ledger reports
|
;; Restore leader key in ledger reports
|
||||||
(map! :after ledger-mode
|
(map! :after ledger-mode
|
||||||
|
@ -51,7 +51,8 @@
|
||||||
(:prefix "g"
|
(:prefix "g"
|
||||||
"s" #'ledger-display-ledger-stats
|
"s" #'ledger-display-ledger-stats
|
||||||
"b" #'ledger-display-balance-at-point))
|
"b" #'ledger-display-balance-at-point))
|
||||||
;; Fix inaccurate keybind message
|
|
||||||
(defun +ledger*fix-key-help (&rest _)
|
(defadvice! +ledger--fix-key-help-a (&rest _)
|
||||||
(message "q to quit; gr to redo; RET to edit; C-c C-s to save"))
|
"Fix inaccurate keybind message."
|
||||||
(advice-add #'ledger-report :after #'+ledger*fix-key-help))
|
:after #'ledger-report
|
||||||
|
(message "q to quit; gr to redo; RET to edit; C-c C-s to save")))
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
;;; lang/nim/config.el -*- lexical-binding: t; -*-
|
;;; lang/nim/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(after! nim-mode
|
(after! nim-mode
|
||||||
(defun +nim|init-nimsuggest-mode ()
|
(add-hook! 'nim-mode-hook
|
||||||
|
(defun +nim-init-nimsuggest-mode-h ()
|
||||||
"Conditionally load `nimsuggest-mode', instead of clumsily erroring out if
|
"Conditionally load `nimsuggest-mode', instead of clumsily erroring out if
|
||||||
nimsuggest isn't installed."
|
nimsuggest isn't installed."
|
||||||
(unless (stringp nimsuggest-path)
|
(unless (stringp nimsuggest-path)
|
||||||
(setq nimsuggest-path (executable-find "nimsuggest")))
|
(setq nimsuggest-path (executable-find "nimsuggest")))
|
||||||
(when (and nimsuggest-path (file-executable-p nimsuggest-path))
|
(when (and nimsuggest-path (file-executable-p nimsuggest-path))
|
||||||
(nimsuggest-mode)))
|
(nimsuggest-mode))))
|
||||||
(add-hook 'nim-mode-hook #'+nim|init-nimsuggest-mode)
|
|
||||||
|
|
||||||
(when IS-WINDOWS
|
(when IS-WINDOWS
|
||||||
;; TODO File PR/report upstream (https://github.com/nim-lang/nim-mode)
|
;; TODO File PR/report upstream (https://github.com/nim-lang/nim-mode)
|
||||||
|
|
|
@ -28,20 +28,20 @@
|
||||||
|
|
||||||
(use-package! utop
|
(use-package! utop
|
||||||
:when (featurep! :tools eval)
|
:when (featurep! :tools eval)
|
||||||
:hook (tuareg-mode . +ocaml|init-utop)
|
:hook (tuareg-mode . +ocaml-init-utop-h)
|
||||||
:init
|
:init
|
||||||
(set-repl-handler! 'tuareg-mode #'utop)
|
(set-repl-handler! 'tuareg-mode #'utop)
|
||||||
(set-eval-handler! 'tuareg-mode #'utop-eval-region)
|
(set-eval-handler! 'tuareg-mode #'utop-eval-region)
|
||||||
(defun +ocaml|init-utop ()
|
(defun +ocaml-init-utop-h ()
|
||||||
(when (executable-find "utop")
|
(when (executable-find "utop")
|
||||||
(utop-minor-mode)))))
|
(utop-minor-mode)))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! merlin
|
(use-package! merlin
|
||||||
:unless (featurep! +lsp)
|
:unless (featurep! +lsp)
|
||||||
:hook (tuareg-mode . +ocaml|init-merlin)
|
:hook (tuareg-mode . +ocaml-init-merlin-h)
|
||||||
:init
|
:init
|
||||||
(defun +ocaml|init-merlin ()
|
(defun +ocaml-init-merlin-h ()
|
||||||
"Activate `merlin-mode' if the ocamlmerlin executable exists."
|
"Activate `merlin-mode' if the ocamlmerlin executable exists."
|
||||||
(when (executable-find "ocamlmerlin")
|
(when (executable-find "ocamlmerlin")
|
||||||
(merlin-mode)))
|
(merlin-mode)))
|
||||||
|
@ -62,9 +62,9 @@
|
||||||
|
|
||||||
(use-package! flycheck-ocaml
|
(use-package! flycheck-ocaml
|
||||||
:when (featurep! :tools flycheck)
|
:when (featurep! :tools flycheck)
|
||||||
:hook (merlin-mode . +ocaml|init-flycheck)
|
:hook (merlin-mode . +ocaml-init-flycheck-h)
|
||||||
:config
|
:config
|
||||||
(defun +ocaml|init-flycheck ()
|
(defun +ocaml-init-flycheck-h ()
|
||||||
"Activate `flycheck-ocaml` if the current project possesses a .merlin file."
|
"Activate `flycheck-ocaml` if the current project possesses a .merlin file."
|
||||||
(when (projectile-locate-dominating-file default-directory ".merlin")
|
(when (projectile-locate-dominating-file default-directory ".merlin")
|
||||||
;; Disable Merlin's own error checking
|
;; Disable Merlin's own error checking
|
||||||
|
@ -90,9 +90,9 @@
|
||||||
(use-package! ocp-indent
|
(use-package! ocp-indent
|
||||||
;; must be careful to always defer this, it has autoloads that adds hooks
|
;; must be careful to always defer this, it has autoloads that adds hooks
|
||||||
;; which we do not want if the executable can't be found
|
;; which we do not want if the executable can't be found
|
||||||
:hook (tuareg-mode . +ocaml|init-ocp-indent)
|
:hook (tuareg-mode . +ocaml-init-ocp-indent-h)
|
||||||
:config
|
:config
|
||||||
(defun +ocaml|init-ocp-indent ()
|
(defun +ocaml-init-ocp-indent-h ()
|
||||||
"Run `ocp-setup-indent', so long as the ocp-indent binary exists."
|
"Run `ocp-setup-indent', so long as the ocp-indent binary exists."
|
||||||
(when (executable-find "ocp-indent")
|
(when (executable-find "ocp-indent")
|
||||||
(ocp-setup-indent))))
|
(ocp-setup-indent))))
|
||||||
|
@ -101,12 +101,12 @@
|
||||||
(use-package! ocamlformat
|
(use-package! ocamlformat
|
||||||
:when (featurep! :editor format)
|
:when (featurep! :editor format)
|
||||||
:commands ocamlformat
|
:commands ocamlformat
|
||||||
:hook (tuareg-mode . +ocaml|init-ocamlformat)
|
:hook (tuareg-mode . +ocaml-init-ocamlformat-h)
|
||||||
:config
|
:config
|
||||||
(set-formatter! 'ocamlformat #'ocamlformat
|
(set-formatter! 'ocamlformat #'ocamlformat
|
||||||
:modes '(caml-mode tuareg-mode))
|
:modes '(caml-mode tuareg-mode))
|
||||||
;; TODO Fix region-based formatting support
|
;; TODO Fix region-based formatting support
|
||||||
(defun +ocaml|init-ocamlformat ()
|
(defun +ocaml-init-ocamlformat-h ()
|
||||||
(setq +format-with 'ocp-indent)
|
(setq +format-with 'ocp-indent)
|
||||||
(when (and (executable-find "ocamlformat")
|
(when (and (executable-find "ocamlformat")
|
||||||
(locate-dominating-file default-directory ".ocamlformat"))
|
(locate-dominating-file default-directory ".ocamlformat"))
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
(+org-present--make-invisible (match-beginning 1) (match-end 1)))))
|
(+org-present--make-invisible (match-beginning 1) (match-end 1)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-present|remove-overlays ()
|
(defun +org-present-remove-overlays-h ()
|
||||||
(mapc #'delete-overlay +org-present--overlays)
|
(mapc #'delete-overlay +org-present--overlays)
|
||||||
(remove-from-invisibility-spec '(+org-present)))
|
(remove-from-invisibility-spec '(+org-present)))
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
(text-scale-set 0)
|
(text-scale-set 0)
|
||||||
(org-remove-latex-fragment-image-overlays)
|
(org-remove-latex-fragment-image-overlays)
|
||||||
(set-face-attribute 'org-level-2 nil :height 1.0)
|
(set-face-attribute 'org-level-2 nil :height 1.0)
|
||||||
(+org-present|remove-overlays)
|
(+org-present-remove-overlays-h)
|
||||||
(org-remove-inline-images)))))
|
(org-remove-inline-images)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,3 @@ ignore the cache."
|
||||||
(require 'json)
|
(require 'json)
|
||||||
(json-read-file package-file)))
|
(json-read-file package-file)))
|
||||||
(puthash project-root data +php-composer-conf))))))
|
(puthash project-root data +php-composer-conf))))))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +php|init-ac-php-core-eldoc ()
|
|
||||||
"Initialize eldoc support for `php-mode' with `ac-php-core'. Fails gracefully
|
|
||||||
if phpctags isn't installed."
|
|
||||||
(require 'ac-php-core)
|
|
||||||
(cond ((not ac-php-ctags-executable))
|
|
||||||
((not (file-exists-p ac-php-ctags-executable))
|
|
||||||
(message "Could not find phpctags executable, eldoc support is disabled")
|
|
||||||
(message "To disable these warnings, set ac-php-ctags-executable to nil"))
|
|
||||||
((ac-php-core-eldoc-setup))))
|
|
||||||
|
|
|
@ -14,17 +14,12 @@
|
||||||
:after plantuml-mode
|
:after plantuml-mode
|
||||||
:config (flycheck-plantuml-setup))
|
:config (flycheck-plantuml-setup))
|
||||||
|
|
||||||
;;
|
|
||||||
;; 1. Add `:cmdline -charset utf-8' to org-src-block:plantuml
|
|
||||||
;;
|
|
||||||
;; 2. Fix `@start' prefix execute error
|
|
||||||
;; When `C-c C-c' is executed in org-src-block:plantuml, if the code starts with
|
|
||||||
;; `@', execution will go wrong. Must be preceded by `\' or `,' to execute
|
|
||||||
;; normally. This code is automatically added `\' before `@start' when `C-c C-c'
|
|
||||||
;; is executed, so that the execution can be carried out normally.
|
|
||||||
;;
|
|
||||||
(after! ob-plantuml
|
(after! ob-plantuml
|
||||||
(defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args)
|
(defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args)
|
||||||
|
"Fix error when executing plantuml src blocks in org-mode for code that
|
||||||
|
begins with '@'. This character needs to be escaped with a backslash or comma
|
||||||
|
for the block to execute correctly, so we do it automatically."
|
||||||
:filter-args #'org-babel-execute:plantuml
|
:filter-args #'org-babel-execute:plantuml
|
||||||
(cl-destructuring-bind (body params) args
|
(cl-destructuring-bind (body params) args
|
||||||
(let* ((origin-body body)
|
(let* ((origin-body body)
|
||||||
|
@ -34,5 +29,6 @@
|
||||||
"\\\\\\1"
|
"\\\\\\1"
|
||||||
origin-body)))
|
origin-body)))
|
||||||
(list fix-body params))))
|
(list fix-body params))))
|
||||||
|
|
||||||
(add-to-list 'org-babel-default-header-args:plantuml
|
(add-to-list 'org-babel-default-header-args:plantuml
|
||||||
'(:cmdline . "-charset utf-8")))
|
'(:cmdline . "-charset utf-8")))
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
(add-hook! 'racket-mode-hook
|
(add-hook! 'racket-mode-hook
|
||||||
#'rainbow-delimiters-mode
|
#'rainbow-delimiters-mode
|
||||||
#'highlight-quoted-mode)
|
#'highlight-quoted-mode)
|
||||||
(set-lookup-handlers! 'racket-mode :definition #'racket-visit-definition)
|
|
||||||
|
|
||||||
(map! :map (racket-mode-map racket-repl-mode-map)
|
(map! :map (racket-mode-map racket-repl-mode-map)
|
||||||
:i "[" #'racket-smart-open-bracket)
|
:i "[" #'racket-smart-open-bracket)
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
(setq-hook! 'restclient-mode-hook
|
(setq-hook! 'restclient-mode-hook
|
||||||
imenu-generic-expression '((nil "^[A-Z]+\s+.+" 0)))
|
imenu-generic-expression '((nil "^[A-Z]+\s+.+" 0)))
|
||||||
|
|
||||||
;; Forces underlying SSL verification to prompt for self-signed or invalid
|
(defadvice! +rest--permit-self-signed-ssl-a (orig-fn &rest args)
|
||||||
;; certs, rather than silently reject them.
|
"Forces underlying SSL verification to prompt for self-signed or invalid
|
||||||
(defun +rest*permit-self-signed-ssl (orig-fn &rest args)
|
certs, rather than silently reject them."
|
||||||
|
:around #'restclient-http-do
|
||||||
(let (gnutls-verify-error tls-checktrust)
|
(let (gnutls-verify-error tls-checktrust)
|
||||||
(apply orig-fn args)))
|
(apply orig-fn args)))
|
||||||
(advice-add #'restclient-http-do :around #'+rest*permit-self-signed-ssl)
|
|
||||||
|
|
||||||
(map! :map restclient-mode-map
|
(map! :map restclient-mode-map
|
||||||
:n [return] #'+rest/dwim-at-point
|
:n [return] #'+rest/dwim-at-point
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
;;; lang/ruby/config.el -*- lexical-binding: t; -*-
|
;;; lang/ruby/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Packages
|
;;; Packages
|
||||||
|
|
||||||
(use-package! enh-ruby-mode
|
(use-package! enh-ruby-mode
|
||||||
:mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby|init)
|
:mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby-init-h)
|
||||||
:mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby|init)
|
:mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby-init-h)
|
||||||
:mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby|init)
|
:mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby-init-h)
|
||||||
:preface
|
:preface
|
||||||
(after! ruby-mode
|
(after! ruby-mode
|
||||||
(require 'enh-ruby-mode))
|
(require 'enh-ruby-mode))
|
||||||
(defun +ruby|init ()
|
(defun +ruby-init-h ()
|
||||||
"Enable `enh-ruby-mode' if ruby is available, otherwise `ruby-mode'."
|
"Enable `enh-ruby-mode' if ruby is available, otherwise `ruby-mode'."
|
||||||
(if (executable-find "ruby")
|
(if (executable-find "ruby")
|
||||||
(enh-ruby-mode)
|
(enh-ruby-mode)
|
||||||
|
@ -33,11 +33,11 @@
|
||||||
(use-package! robe
|
(use-package! robe
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(defun +ruby|init-robe-mode-maybe ()
|
(add-hook! 'enh-ruby-mode-hook
|
||||||
|
(defun +ruby-init-robe-mode-maybe-h ()
|
||||||
"Start `robe-mode' if `lsp-mode' isn't active."
|
"Start `robe-mode' if `lsp-mode' isn't active."
|
||||||
(unless (bound-and-true-p lsp-mode)
|
(unless (bound-and-true-p lsp-mode)
|
||||||
(robe-mode +1)))
|
(robe-mode +1))))
|
||||||
(add-hook 'enh-ruby-mode-hook #'+ruby|init-robe-mode-maybe)
|
|
||||||
:config
|
:config
|
||||||
(set-repl-handler! 'enh-ruby-mode #'robe-start)
|
(set-repl-handler! 'enh-ruby-mode #'robe-start)
|
||||||
(set-company-backend! 'enh-ruby-mode 'company-robe)
|
(set-company-backend! 'enh-ruby-mode 'company-robe)
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Package & Ruby version management
|
;;; Package & Ruby version management
|
||||||
|
|
||||||
(use-package! rake
|
(use-package! rake
|
||||||
:defer t
|
:defer t
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Testing frameworks
|
;;; Testing frameworks
|
||||||
|
|
||||||
(use-package! rspec-mode
|
(use-package! rspec-mode
|
||||||
:mode ("/\\.rspec\\'" . text-mode)
|
:mode ("/\\.rspec\\'" . text-mode)
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
;; indent block comments to first asterix, not second
|
;; indent block comments to first asterix, not second
|
||||||
scala-indent:use-javadoc-style t)
|
scala-indent:use-javadoc-style t)
|
||||||
|
|
||||||
(setq-hook! 'scala-mode-hook comment-line-break-function #'+scala-comment-indent-new-line)
|
(setq-hook! 'scala-mode-hook
|
||||||
|
comment-line-break-function #'+scala-comment-indent-new-line)
|
||||||
|
|
||||||
(after! dtrt-indent
|
(after! dtrt-indent
|
||||||
(add-to-list 'dtrt-indent-hook-mapping-list '(scala-mode c/c++/java scala-indent:step)))
|
(add-to-list 'dtrt-indent-hook-mapping-list '(scala-mode c/c++/java scala-indent:step)))
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
;;
|
;;
|
||||||
;; Packages
|
;; Packages
|
||||||
|
|
||||||
;; `solidity-mode'
|
;;;###package solidity-mode
|
||||||
(setq solidity-comment-style 'slash)
|
(setq solidity-comment-style 'slash)
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,5 +22,5 @@
|
||||||
:when (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
:after solidity-mode
|
:after solidity-mode
|
||||||
:config
|
:config
|
||||||
(setq company-backends (delq 'company-solidity company-backends))
|
(delq! 'company-solidity company-backends)
|
||||||
(set-company-backend! 'solidity-mode 'company-solidity))
|
(set-company-backend! 'solidity-mode 'company-solidity))
|
||||||
|
|
|
@ -5,15 +5,15 @@
|
||||||
|
|
||||||
|
|
||||||
(use-package! flycheck-swift
|
(use-package! flycheck-swift
|
||||||
:when (and (featurep! :tools flycheck)
|
:when (featurep! :tools flycheck)
|
||||||
(not (featurep! +lsp)))
|
:unless (featurep! +lsp)
|
||||||
:after swift-mode
|
:after swift-mode
|
||||||
:config (flycheck-swift-setup))
|
:config (flycheck-swift-setup))
|
||||||
|
|
||||||
|
|
||||||
(use-package! company-sourcekit
|
(use-package! company-sourcekit
|
||||||
:when (and (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
(not (featurep! +lsp)))
|
:unless (featurep! +lsp)
|
||||||
:after swift-mode
|
:after swift-mode
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'swift-mode '(company-sourcekit company-yasnippet)))
|
(set-company-backend! 'swift-mode '(company-sourcekit company-yasnippet)))
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Major modes
|
;;; Major modes
|
||||||
|
|
||||||
(use-package! terra-mode
|
(after! terra-mode
|
||||||
:defer t
|
(set-lookup-handlers! 'terra-mode
|
||||||
:config
|
:documentation #'terra-search-documentation)
|
||||||
(set-lookup-handlers! 'terra-mode :documentation 'terra-search-documentation)
|
|
||||||
(set-electric! 'terra-mode :words '("else" "end"))
|
(set-electric! 'terra-mode :words '("else" "end"))
|
||||||
(set-repl-handler! 'terra-mode #'+terra/open-repl)
|
(set-repl-handler! 'terra-mode #'+terra/open-repl)
|
||||||
(set-company-backend! 'terra-mode '(company-lua company-yasnippet)))
|
(set-company-backend! 'terra-mode '(company-lua company-yasnippet)))
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
;;; lang/web/+css.el -*- lexical-binding: t; -*-
|
;;; lang/web/+css.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; An improved newline+continue comment function
|
;; An improved newline+continue comment function
|
||||||
(setq-hook! css-mode comment-indent-function #'+css/comment-indent-new-line)
|
(setq-hook! css-mode
|
||||||
|
comment-indent-function #'+css/comment-indent-new-line)
|
||||||
|
|
||||||
(map! :map (css-mode-map scss-mode-map less-css-mode-map)
|
(map! :map (css-mode-map scss-mode-map less-css-mode-map)
|
||||||
:localleader
|
:localleader
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
;;; lang/web/+html.el -*- lexical-binding: t; -*-
|
;;; lang/web/+html.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package! web-mode
|
(use-package! web-mode
|
||||||
:mode "\\.p?html?$"
|
:mode "\\.p?html?\\'"
|
||||||
:mode "\\.\\(?:tpl\\|blade\\)\\(\\.php\\)?$"
|
:mode "\\.\\(?:tpl\\|blade\\)\\(?:\\.php\\)?\\'"
|
||||||
:mode "\\.erb$"
|
:mode "\\.erb\\'"
|
||||||
:mode "\\.jsp$"
|
:mode "\\.jsp\\'"
|
||||||
:mode "\\.as[cp]x$"
|
:mode "\\.as[cp]x\\'"
|
||||||
:mode "\\.hbs$"
|
:mode "\\.hbs\\'"
|
||||||
:mode "\\.mustache$"
|
:mode "\\.mustache\\'"
|
||||||
:mode "\\.tsx$"
|
:mode "\\.tsx\\'"
|
||||||
:mode "\\.vue$"
|
:mode "\\.vue\\'"
|
||||||
:mode "\\.twig$"
|
:mode "\\.twig\\'"
|
||||||
:mode "\\.jinja$"
|
:mode "\\.jinja\\'"
|
||||||
:mode "wp-content/themes/.+/.+\\.php$"
|
:mode "wp-content/themes/.+/.+\\.php\\'"
|
||||||
:mode "templates/.+\\.php$"
|
:mode "templates/.+\\.php\\'"
|
||||||
:config
|
:config
|
||||||
(set-docsets! 'web-mode "HTML" "CSS" "Twig" "WordPress")
|
(set-docsets! 'web-mode "HTML" "CSS" "Twig" "WordPress")
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Framework-based minor-modes
|
;;; Framework-based minor-modes
|
||||||
|
|
||||||
(def-project-mode! +web-jekyll-mode
|
(def-project-mode! +web-jekyll-mode
|
||||||
:modes '(web-mode js-mode coffee-mode css-mode haml-mode pug-mode)
|
:modes '(web-mode js-mode coffee-mode css-mode haml-mode pug-mode)
|
||||||
|
|
|
@ -55,13 +55,13 @@
|
||||||
(defvar-local +magit--vc-is-stale-p nil)
|
(defvar-local +magit--vc-is-stale-p nil)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +magit|refresh-vc-state-maybe ()
|
(defun +magit-refresh-vc-state-maybe-h ()
|
||||||
"Update `vc' and `git-gutter' if out of date."
|
"Update `vc' and `git-gutter' if out of date."
|
||||||
(when +magit--vc-is-stale-p
|
(when +magit--vc-is-stale-p
|
||||||
(+magit--refresh-vc-in-buffer (current-buffer))))
|
(+magit--refresh-vc-in-buffer (current-buffer))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(add-hook 'doom-switch-buffer-hook #'+magit|refresh-vc-state-maybe)
|
(add-hook 'doom-switch-buffer-hook #'+magit-refresh-vc-state-maybe-h)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +magit/quit (&optional _kill-buffer)
|
(defun +magit/quit (&optional _kill-buffer)
|
||||||
|
|
|
@ -33,19 +33,19 @@
|
||||||
(put (car sym) 'safe-local-variable (cdr sym)))
|
(put (car sym) 'safe-local-variable (cdr sym)))
|
||||||
|
|
||||||
;; Maybe auto-upload on save
|
;; Maybe auto-upload on save
|
||||||
(defun +upload|init-after-save ()
|
(add-hook! 'after-save-hook
|
||||||
|
(defun +upload-init-after-save-h ()
|
||||||
(when (and (bound-and-true-p ssh-deploy-root-remote)
|
(when (and (bound-and-true-p ssh-deploy-root-remote)
|
||||||
ssh-deploy-on-explicit-save)
|
ssh-deploy-on-explicit-save)
|
||||||
(ssh-deploy-upload-handler)))
|
(ssh-deploy-upload-handler))))
|
||||||
(add-hook 'after-save-hook #'+upload|init-after-save)
|
|
||||||
|
|
||||||
;; Enable ssh-deploy if variables are set, and check for changes on open file
|
;; Enable ssh-deploy if variables are set, and check for changes on open file
|
||||||
;; (if possible)
|
;; (if possible)
|
||||||
(defun +upload|init-find-file ()
|
(add-hook! 'find-file-hook
|
||||||
|
(defun +upload-init-find-file-h ()
|
||||||
(when (bound-and-true-p ssh-deploy-root-remote)
|
(when (bound-and-true-p ssh-deploy-root-remote)
|
||||||
(require 'ssh-deploy)
|
(require 'ssh-deploy)
|
||||||
(unless ssh-deploy-root-local
|
(unless ssh-deploy-root-local
|
||||||
(setq ssh-deploy-root-local (doom-project-root)))
|
(setq ssh-deploy-root-local (doom-project-root)))
|
||||||
(when ssh-deploy-automatically-detect-remote-changes
|
(when ssh-deploy-automatically-detect-remote-changes
|
||||||
(ssh-deploy-remote-changes-handler))))
|
(ssh-deploy-remote-changes-handler))))))
|
||||||
(add-hook 'find-file-hook #'+upload|init-find-file))
|
|
||||||
|
|
|
@ -112,11 +112,11 @@
|
||||||
("~~>" . #Xe169)
|
("~~>" . #Xe169)
|
||||||
("%%" . #Xe16a)))
|
("%%" . #Xe16a)))
|
||||||
|
|
||||||
(defun +pretty-code|setup-fira-ligatures ()
|
(defun +pretty-code-setup-fira-ligatures-h ()
|
||||||
(set-fontset-font t '(#Xe100 . #Xe16f) +pretty-code-fira-code-font-name)
|
(set-fontset-font t '(#Xe100 . #Xe16f) +pretty-code-fira-code-font-name)
|
||||||
(setq-default prettify-symbols-alist
|
(setq-default prettify-symbols-alist
|
||||||
(append prettify-symbols-alist
|
(append prettify-symbols-alist
|
||||||
(mapcar #'+pretty-code--correct-symbol-bounds
|
(mapcar #'+pretty-code--correct-symbol-bounds
|
||||||
+pretty-code-fira-code-font-ligatures))))
|
+pretty-code-fira-code-font-ligatures))))
|
||||||
|
|
||||||
(add-hook 'doom-init-ui-hook #'+pretty-code|setup-fira-ligatures)
|
(add-hook 'doom-init-ui-hook #'+pretty-code-setup-fira-ligatures-h)
|
||||||
|
|
|
@ -48,11 +48,11 @@
|
||||||
("<->" . #Xe129)))
|
("<->" . #Xe129)))
|
||||||
|
|
||||||
|
|
||||||
(defun +pretty-code|setup-hasklig-ligatures ()
|
(defun +pretty-code-setup-hasklig-ligatures-h ()
|
||||||
(set-fontset-font t '(#Xe100 . #Xe129) +pretty-code-hasklig-font-name)
|
(set-fontset-font t '(#Xe100 . #Xe129) +pretty-code-hasklig-font-name)
|
||||||
(setq-default prettify-symbols-alist
|
(setq-default prettify-symbols-alist
|
||||||
(append prettify-symbols-alist
|
(append prettify-symbols-alist
|
||||||
(mapcar #'+pretty-code--correct-symbol-bounds
|
(mapcar #'+pretty-code--correct-symbol-bounds
|
||||||
+pretty-code-hasklig-font-ligatures))))
|
+pretty-code-hasklig-font-ligatures))))
|
||||||
|
|
||||||
(add-hook 'doom-init-ui-hook #'+pretty-code|setup-hasklig-ligatures)
|
(add-hook 'doom-init-ui-hook #'+pretty-code-setup-hasklig-ligatures-h)
|
||||||
|
|
|
@ -223,11 +223,10 @@
|
||||||
("+>" . #Xe1cc))
|
("+>" . #Xe1cc))
|
||||||
"Defines the character mappings for ligatures for Iosevka.")
|
"Defines the character mappings for ligatures for Iosevka.")
|
||||||
|
|
||||||
(defun +pretty-code|setup-iosevka-ligatures ()
|
(defun +pretty-code-setup-iosevka-ligatures-h ()
|
||||||
(set-fontset-font t '(#Xe100 . #Xe1cc) +pretty-code-iosevka-font-name)
|
(set-fontset-font t '(#Xe100 . #Xe1cc) +pretty-code-iosevka-font-name)
|
||||||
(setq-default prettify-symbols-alist
|
(setq-default prettify-symbols-alist
|
||||||
(append prettify-symbols-alist
|
(append prettify-symbols-alist
|
||||||
+pretty-code-iosevka-font-ligatures)))
|
+pretty-code-iosevka-font-ligatures)))
|
||||||
|
|
||||||
(add-hook 'doom-init-ui-hook #'+pretty-code|setup-iosevka-ligatures)
|
(add-hook 'doom-init-ui-hook #'+pretty-code-setup-iosevka-ligatures-h)
|
||||||
|
|
||||||
|
|
|
@ -198,10 +198,10 @@
|
||||||
("\">" . #XEA90))
|
("\">" . #XEA90))
|
||||||
"Defines the character mappings for ligatures for Pragmata Pro.")
|
"Defines the character mappings for ligatures for Pragmata Pro.")
|
||||||
|
|
||||||
(defun +pretty-code|setup-pragmata-pro-ligatures ()
|
(defun +pretty-code-setup-pragmata-pro-ligatures-h ()
|
||||||
(setq-default prettify-symbols-alist
|
(setq-default prettify-symbols-alist
|
||||||
(append prettify-symbols-alist
|
(append prettify-symbols-alist
|
||||||
(mapcar #'+pretty-code--correct-symbol-bounds
|
(mapcar #'+pretty-code--correct-symbol-bounds
|
||||||
+pretty-code-pragmata-pro-font-ligatures))))
|
+pretty-code-pragmata-pro-font-ligatures))))
|
||||||
|
|
||||||
(add-hook 'doom-init-ui-hook #'+pretty-code|setup-pragmata-pro-ligatures)
|
(add-hook 'doom-init-ui-hook #'+pretty-code-setup-pragmata-pro-ligatures-h)
|
||||||
|
|
|
@ -17,7 +17,7 @@ besides what is listed.")
|
||||||
;; When you get to the right edge, it goes back to how it normally prints
|
;; When you get to the right edge, it goes back to how it normally prints
|
||||||
(setq prettify-symbols-unprettify-at-point 'right-edge)
|
(setq prettify-symbols-unprettify-at-point 'right-edge)
|
||||||
|
|
||||||
(defun +pretty-code|init-pretty-symbols ()
|
(defun +pretty-code-init-pretty-symbols-h ()
|
||||||
"Enable `prettify-symbols-mode'.
|
"Enable `prettify-symbols-mode'.
|
||||||
|
|
||||||
If in fundamental-mode, or a mode derived from special, comint, eshell or term
|
If in fundamental-mode, or a mode derived from special, comint, eshell or term
|
||||||
|
@ -39,4 +39,4 @@ Otherwise it builds `prettify-code-symbols-alist' according to
|
||||||
(prettify-symbols-mode -1))
|
(prettify-symbols-mode -1))
|
||||||
(prettify-symbols-mode +1))))
|
(prettify-symbols-mode +1))))
|
||||||
|
|
||||||
(add-hook 'after-change-major-mode-hook #'+pretty-code|init-pretty-symbols)
|
(add-hook 'after-change-major-mode-hook #'+pretty-code-init-pretty-symbols-h)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue