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$"
|
||||
:config
|
||||
;; disable standard config; more disruptive than it needs to be
|
||||
(dolist (beg '("fn" "do" "def" "defp" "defmodule" "if" "unless" "case" "receive"))
|
||||
(sp-local-pair 'elixir-mode beg nil :actions :rem))
|
||||
(map-delete sp-pairs 'elixir-mode)
|
||||
;; only complete the basics
|
||||
(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 "fn " " end")))
|
||||
(sp-local-pair "do" "end"
|
||||
:when '(("RET" "<evil-ret>"))
|
||||
: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
|
||||
:after elixir-mode
|
||||
:hook (elixir-mode . alchemist-mode)
|
||||
:config
|
||||
(set! :lookup 'elixir-mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue