Remove :editorconfig setting
This commit is contained in:
parent
9d81bc5a8b
commit
f063a08891
3 changed files with 9 additions and 19 deletions
|
@ -171,17 +171,6 @@ with functions that require it (like modeline segments)."
|
||||||
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
|
;; Handles whitespace (tabs/spaces) settings externally. This way projects can
|
||||||
;; specify their own formatting rules.
|
;; specify their own formatting rules.
|
||||||
(def-package! editorconfig
|
(def-package! editorconfig
|
||||||
:init
|
|
||||||
(def-setting! :editorconfig (action value)
|
|
||||||
":add or :remove an entry in `editorconfig-indentation-alist'."
|
|
||||||
(cond ((eq action :add)
|
|
||||||
`(push ,value editorconfig-indentation-alist))
|
|
||||||
((eq action :remove)
|
|
||||||
`(setq editorconfig-indentation-alist
|
|
||||||
(assq-delete-all ,value editorconfig-indentation-alist)))
|
|
||||||
(t (error "%s is an invalid action for :editorconfig"
|
|
||||||
action))))
|
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(add-hook 'doom-init-hook #'editorconfig-mode)
|
(add-hook 'doom-init-hook #'editorconfig-mode)
|
||||||
|
|
||||||
|
@ -211,10 +200,12 @@ extension, try to guess one."
|
||||||
(apply orig-fn args)))
|
(apply orig-fn args)))
|
||||||
(advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)
|
(advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)
|
||||||
|
|
||||||
;; Editorconfig makes indentation weird in Lisp modes, so we disable it. It
|
;; Editorconfig makes indentation too rigid in Lisp modes, so tell
|
||||||
;; still applies other project settings (e.g. tabs vs spaces) though.
|
;; editorconfig to ignore indentation. I prefer dynamic indentation support
|
||||||
(set! :editorconfig :remove 'emacs-lisp-mode)
|
;; built into Emacs.
|
||||||
(set! :editorconfig :remove 'lisp-mode)
|
(dolist (mode '(emacs-lisp-mode lisp-mode))
|
||||||
|
(setq editorconfig-indentation-alist
|
||||||
|
(assq-delete-all mode editorconfig-indentation-alist)))
|
||||||
|
|
||||||
(defvar whitespace-style)
|
(defvar whitespace-style)
|
||||||
(defun doom|editorconfig-whitespace-mode-maybe (&rest _)
|
(defun doom|editorconfig-whitespace-mode-maybe (&rest _)
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
(set! :electric 'js2-mode :chars '(?\} ?\) ?.))
|
(set! :electric 'js2-mode :chars '(?\} ?\) ?.))
|
||||||
(set! :jump 'js2-mode :xref-backend #'xref-js2-xref-backend)
|
(set! :jump 'js2-mode :xref-backend #'xref-js2-xref-backend)
|
||||||
|
|
||||||
;; Conform switch-case indentation to editorconfig's config
|
;; Conform switch-case indentation to js2 normal indent
|
||||||
(set! :editorconfig :add '(js2-mode js2-basic-offset js-switch-indent-offset))
|
(defvaralias 'js-switch-indent-offset 'js2-basic-offset)
|
||||||
|
|
||||||
(sp-with-modes '(js2-mode rjsx-mode)
|
(sp-with-modes '(js2-mode rjsx-mode)
|
||||||
(sp-local-pair "/* " " */" :post-handlers '(("| " "SPC"))))
|
(sp-local-pair "/* " " */" :post-handlers '(("| " "SPC"))))
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
|
|
||||||
(def-package! moonscript
|
(def-package! moonscript
|
||||||
:mode ("\\.moon$" . moonscript-mode)
|
:mode ("\\.moon$" . moonscript-mode)
|
||||||
:config
|
:config (defvaralias 'moonscript-indent-offset 'tab-width))
|
||||||
(set! :editorconfig :add '(moonscript-mode moonscript-indent-offset)))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue