all repos — archive/dotfiles @ 80148c26109d41cdfff6240f084f62b7573309be

Superseded by nixfiles

Emacs: Use electric-pair mode in nix-mode buffers

It seems to work better than smartparens
Alan Pearce alan@alanpearce.eu
Sat, 09 Sep 2017 20:09:09 +0200
commit

80148c26109d41cdfff6240f084f62b7573309be

parent

b5919c4a52db991ea9a60410d27751afe6c87f75

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -1694,7 +1694,13 @@ (use-package dockerfile-mode   :mode (("Dockerfile\\'" . dockerfile-mode)))
 
 (use-package nix-mode
-  :mode (("\\.nix\\'" . nix-mode)))
+  :mode (("\\.nix\\'" . nix-mode))
+  :config (progn
+            (define-hook-helper nix-mode ()
+              (when (fboundp 'smartparens-mode)
+                (smartparens-strict-mode -1)
+                (smartparens-mode -1))
+              (electric-pair-mode +1))))
 
 (define-derived-mode xmonad-mode haskell-mode "XM")
 (add-to-list 'auto-mode-alist '("xmobarrc\\'" . xmonad-mode))