nvim/autopair: add ruler to haskell like rules

This commit is contained in:
Primrose 2025-10-13 12:00:37 +08:00
parent 8fe45de542
commit 8137ac9b28
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -5,7 +5,7 @@ local cmp = require("cmp")
local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local langs = { local langs = {
haskell_like = { "haskell", "nix" }, haskell_like = { "haskell", "nix", "ruler" },
ml_like = { "ocaml", "why3", "skel", "isabelle" }, ml_like = { "ocaml", "why3", "skel", "isabelle" },
html_like = { "html", "htmldjango" }, html_like = { "html", "htmldjango" },
latex_like = { "typst", "latex" }, latex_like = { "typst", "latex" },
@ -81,10 +81,10 @@ npairs.add_rules {
} }
pair_with_insertion("$", " ", "$", langs.latex_like) pair_with_insertion("$", " ", "$", langs.latex_like)
pair_with_insertion("{", "-", "}", "haskell") pair_with_insertion("{", "-", "}", langs.haskell_like)
pair_with_insertion("{-", " ", "-}", "haskell") -- block comment pair_with_insertion("{-", " ", "-}", langs.haskell_like) -- block comment
pair_with_insertion("{-", "#", "-}", "haskell") -- language flags pair_with_insertion("{-", "#", "-}", langs.haskell_like) -- language flags
pair_with_insertion("{-#", " ", "#-}", "haskell") pair_with_insertion("{-#", " ", "#-}", langs.haskell_like)
pair_with_insertion("(", " ", ")", langs.haskell_like) pair_with_insertion("(", " ", ")", langs.haskell_like)
npairs.add_rules { npairs.add_rules {