summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-09-09 20:09:09 +0200
committerAlan Pearce2017-09-09 20:09:09 +0200
commit80148c26109d41cdfff6240f084f62b7573309be (patch)
treec48898360e049baa97ee16516ac4699ac1c7c19b /emacs
parentb5919c4a52db991ea9a60410d27751afe6c87f75 (diff)
downloadnixfiles-80148c26109d41cdfff6240f084f62b7573309be.tar.lz
nixfiles-80148c26109d41cdfff6240f084f62b7573309be.tar.zst
nixfiles-80148c26109d41cdfff6240f084f62b7573309be.zip
Emacs: Use electric-pair mode in nix-mode buffers
It seems to work better than smartparens
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/main.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 6e4a5813..b546979d 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -1694,7 +1694,13 @@ With prefix TO-CURRENT-BUFFER, insert command output into buffer."
   :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))