mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
fix(sml): mirror sml-mode config to sml-ts-mode
This commit is contained in:
parent
3c10db6824
commit
055788047c
1 changed files with 14 additions and 11 deletions
|
|
@ -1,20 +1,19 @@
|
||||||
;;; lang/sml/config.el -*- lexical-binding: t; -*-
|
;;; lang/sml/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package! sml-mode
|
|
||||||
:mode "\\.s\\(?:ml\\|ig\\)\\'"
|
(defun +sml-common-config (mode)
|
||||||
:config
|
(set-repl-handler! mode #'run-sml)
|
||||||
(set-repl-handler! '(sml-mode sml-ts-mode) #'run-sml)
|
(set-formatter! 'smlformat '("smlformat") :modes mode)
|
||||||
(set-formatter! 'smlformat '("smlformat") :modes '(sml-mode sml-ts-mode))
|
|
||||||
|
|
||||||
(when (modulep! +lsp)
|
(when (modulep! +lsp)
|
||||||
(add-hook 'sml-mode-local-vars-hook #'lsp! 'append))
|
(add-hook (intern (format "%s-local-vars-hook" mode)) #'lsp! 'append))
|
||||||
|
|
||||||
;; don't auto-close apostrophes (type 'a = foo) and backticks (`Foo)
|
;; don't auto-close apostrophes (type 'a = foo) and backticks (`Foo)
|
||||||
(sp-with-modes '(sml-mode sml-ts-mode)
|
(sp-with-modes mode
|
||||||
(sp-local-pair "'" nil :actions nil)
|
(sp-local-pair "'" nil :actions nil)
|
||||||
(sp-local-pair "`" nil :actions nil))
|
(sp-local-pair "`" nil :actions nil))
|
||||||
|
|
||||||
(map! :map sml-mode-map
|
(map! :map ,(intern (format "%s-map" mode))
|
||||||
:i "RET" #'reindent-then-newline-and-indent
|
:i "RET" #'reindent-then-newline-and-indent
|
||||||
:i "S-SPC" #'sml-electric-space
|
:i "S-SPC" #'sml-electric-space
|
||||||
:i "|" #'sml-electric-pipe
|
:i "|" #'sml-electric-pipe
|
||||||
|
|
@ -26,7 +25,12 @@
|
||||||
:desc "Run region" "r" #'sml-prog-proc-send-region))
|
:desc "Run region" "r" #'sml-prog-proc-send-region))
|
||||||
|
|
||||||
|
|
||||||
;; TODO: Mirror sml-mode keybinds to ts-mode
|
(use-package! sml-mode
|
||||||
|
:mode "\\.s\\(?:ml\\|ig\\)\\'"
|
||||||
|
:config
|
||||||
|
(+sml-common-config 'sml-mode))
|
||||||
|
|
||||||
|
|
||||||
(use-package! sml-ts-mode
|
(use-package! sml-ts-mode
|
||||||
:when (modulep! +tree-sitter)
|
:when (modulep! +tree-sitter)
|
||||||
:defer t
|
:defer t
|
||||||
|
|
@ -34,8 +38,7 @@
|
||||||
(set-tree-sitter! 'sml-mode 'sml-ts-mode
|
(set-tree-sitter! 'sml-mode 'sml-ts-mode
|
||||||
'((sml :url "https://github.com/MatthewFluet/tree-sitter-sml")))
|
'((sml :url "https://github.com/MatthewFluet/tree-sitter-sml")))
|
||||||
:config
|
:config
|
||||||
(when (modulep! +lsp)
|
(+sml-common-config 'sml-ts-mode))
|
||||||
(add-hook 'sml-ts-mode-local-vars-hook #'lsp! 'append)))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! company-mlton
|
(use-package! company-mlton
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue