ref(nvim): fennel-ized autopairs

This commit is contained in:
Léana 江 2024-01-27 23:41:49 +01:00 committed by Léana 江
parent 840b7715a8
commit 8952da1ccb
2 changed files with 18 additions and 30 deletions

View file

@ -0,0 +1,18 @@
(local Rule (require :nvim-autopairs.rule))
(local cond (require :nvim-autopairs.conds))
(local npairs (require :nvim-autopairs))
(npairs.setup {:disable_filetype [:fennel :clojure :lisp :racket :scheme]})
(local cmp (require :cmp))
(local cmp-autopairs (require :nvim-autopairs.completion.cmp))
(cmp.event:on :confirm_done (cmp-autopairs.on_confirm_done))
(npairs.add_rules [(-> (Rule "$" "$" [:tex :typst])
(: :with_pair (cond.not_before_regex "%a"))
(: :with_pair (cond.not_after_regex "%a"))
(: :with_move cond.done))
(-> (Rule "```" "```" :typst)
(: :with_pair (cond.not_before_text "```"))
(: :with_cr cond.done))])