feat(emacs): Support Nix's ''big quotes''

This commit is contained in:
Madeleine Sydney
2025-03-04 03:10:59 -07:00
parent 04a23ded90
commit a8943c5d67
2 changed files with 22 additions and 16 deletions

View File

@@ -26,6 +26,15 @@
(set-popup-rule! (rx bol "*nixos-options-doc*" eol) :ttl 0 :quit t)
(set-repl-handler! 'nix-mode #'syd-nix-open-nix-repl)
(dolist (c '(?- ?_))
(modify-syntax-entry c "w" nix-mode-syntax-table)))
(modify-syntax-entry c "w" nix-mode-syntax-table))
;; Inform Smartparens and Evil-surround of Nix's alternative string syntax.
(with-eval-after-load 'smartparens
(sp-local-pair 'nix-mode "''" "''"))
(syd-add-hook 'nix-mode-hook
(defun syd-nix--configure-evil-surround-h ()
(with-eval-after-load 'evil-surround
(push '(?Q . ("''" . "''"))
evil-surround-pairs-alist)))))
(provide 'syd-lang-nix)