lang/elixir: refactor smartparens+use-package config
This commit is contained in:
parent
c998cebd31
commit
8c0a4cfbef
1 changed files with 8 additions and 6 deletions
|
@ -5,17 +5,19 @@
|
||||||
:mode "\\.elixir2$"
|
:mode "\\.elixir2$"
|
||||||
:config
|
:config
|
||||||
;; disable standard config; more disruptive than it needs to be
|
;; disable standard config; more disruptive than it needs to be
|
||||||
(dolist (beg '("fn" "do" "def" "defp" "defmodule" "if" "unless" "case" "receive"))
|
(map-delete sp-pairs 'elixir-mode)
|
||||||
(sp-local-pair 'elixir-mode beg nil :actions :rem))
|
|
||||||
;; only complete the basics
|
;; only complete the basics
|
||||||
(sp-with-modes 'elixir-mode
|
(sp-with-modes 'elixir-mode
|
||||||
(sp-local-pair "do" "end" :when '(("RET" "<evil-ret>")) :post-handlers '("||\n[i]"))
|
(sp-local-pair "do" "end"
|
||||||
(sp-local-pair "do " " end")
|
:when '(("RET" "<evil-ret>"))
|
||||||
(sp-local-pair "fn " " end")))
|
:unless '(sp-in-comment-p sp-in-string-p)
|
||||||
|
:skip-match 'sp-elixir-skip-def-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
|
(def-package! alchemist
|
||||||
:after elixir-mode
|
|
||||||
:hook (elixir-mode . alchemist-mode)
|
:hook (elixir-mode . alchemist-mode)
|
||||||
:config
|
:config
|
||||||
(set! :lookup 'elixir-mode
|
(set! :lookup 'elixir-mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue