Minor, general refactors
Also rename custom lookup handlers for consistency and use the new inline :async property instead.
This commit is contained in:
parent
d17764366e
commit
1c976dc0e4
6 changed files with 18 additions and 13 deletions
|
@ -141,7 +141,7 @@
|
||||||
;; OS specific fixes
|
;; OS specific fixes
|
||||||
(when IS-MAC
|
(when IS-MAC
|
||||||
;; Fix MacOS shift+tab
|
;; Fix MacOS shift+tab
|
||||||
(define-key input-decode-map [S-iso-lefttab] [backtab])
|
(define-key key-translation-map [S-iso-lefttab] [backtab])
|
||||||
;; Fix conventional OS keys in Emacs
|
;; Fix conventional OS keys in Emacs
|
||||||
(map! "s-`" #'other-frame ; fix frame-switching
|
(map! "s-`" #'other-frame ; fix frame-switching
|
||||||
;; fix OS window/frame navigation/manipulation keys
|
;; fix OS window/frame navigation/manipulation keys
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
;;; lang/clojure/autoload.el -*- lexical-binding: t; -*-
|
;;; lang/clojure/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +clojure-cider-lookup-definition (identifier)
|
||||||
|
"A lookup handler for `cider-mode'.
|
||||||
|
|
||||||
|
This is necessary to fix `cider-find-dwim's inability to capture the full symbol
|
||||||
|
at point."
|
||||||
|
(cider-find-dwim identifier))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;;; Commands
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +clojure/repl (&optional arg)
|
(defun +clojure/repl (&optional arg)
|
||||||
"Open a Cider REPL and return the buffer."
|
"Open a Cider REPL and return the buffer."
|
||||||
|
@ -12,9 +24,3 @@
|
||||||
"TODO"
|
"TODO"
|
||||||
(interactive)
|
(interactive)
|
||||||
(cider-switch-to-repl-buffer t))
|
(cider-switch-to-repl-buffer t))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun +clojure-lookup-symbol (identifier)
|
|
||||||
"A lookup handler for `cider-find-dwim'.
|
|
||||||
This is necessary to fix its inability to capture the full symbol at point."
|
|
||||||
(cider-find-dwim identifier))
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(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)
|
||||||
(set-lookup-handlers! 'cider-mode
|
(set-lookup-handlers! 'cider-mode
|
||||||
:definition #'+clojure-lookup-symbol
|
:definition #'+clojure-cider-lookup-definition
|
||||||
:documentation #'cider-doc)
|
:documentation #'cider-doc)
|
||||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -30,7 +30,6 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
||||||
:symbols '(("t" "nil")
|
:symbols '(("t" "nil")
|
||||||
("let" "let*")
|
("let" "let*")
|
||||||
("when" "unless")
|
("when" "unless")
|
||||||
("append" "prepend")
|
|
||||||
("advice-add" "advice-remove")
|
("advice-add" "advice-remove")
|
||||||
("add-hook" "remove-hook")
|
("add-hook" "remove-hook")
|
||||||
("add-hook!" "remove-hook!")))
|
("add-hook!" "remove-hook!")))
|
||||||
|
|
|
@ -159,9 +159,9 @@
|
||||||
(setq-default company-backends (delq 'company-tide (default-value 'company-backends))))
|
(setq-default company-backends (delq 'company-tide (default-value 'company-backends))))
|
||||||
(set-company-backend! 'tide-mode 'company-tide)
|
(set-company-backend! 'tide-mode 'company-tide)
|
||||||
;; navigation
|
;; navigation
|
||||||
(set-lookup-handlers! 'tide-mode :async t
|
(set-lookup-handlers! 'tide-mode
|
||||||
:definition #'tide-jump-to-definition
|
:definition '(tide-jump-to-definition :async t)
|
||||||
:references #'tide-references)
|
:references '(tide-references :async t))
|
||||||
;; resolve to `doom-project-root' if `tide-project-root' fails
|
;; resolve to `doom-project-root' if `tide-project-root' fails
|
||||||
(advice-add #'tide-project-root :override #'+javascript*tide-project-root)
|
(advice-add #'tide-project-root :override #'+javascript*tide-project-root)
|
||||||
;; cleanup tsserver when no tide buffers are left
|
;; cleanup tsserver when no tide buffers are left
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
(if (string-match "\\(?:>\\|]\\|}\\)+\\'" string)
|
(if (string-match "\\(?:>\\|]\\|}\\)+\\'" string)
|
||||||
(replace-match "" t t string)
|
(replace-match "" t t string)
|
||||||
string))))))
|
string))))))
|
||||||
(delq (assq nil web-mode-engines-auto-pairs) web-mode-engines-auto-pairs))
|
(delq! nil web-mode-engines-auto-pairs))
|
||||||
|
|
||||||
(map! :map web-mode-map
|
(map! :map web-mode-map
|
||||||
(:localleader
|
(:localleader
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue