From 8b71ddf0932cfd2e17ca904df633d6de122cec71 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 27 Sep 2022 23:45:25 -0700 Subject: [PATCH] =?UTF-8?q?[oni-groovy]=20Add=20=E2=80=98/=E2=80=99=20as?= =?UTF-8?q?=20a=20pair=20for=20smartparens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oni-groovy.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/oni-groovy.el b/oni-groovy.el index 381c0ad..b8f5211 100644 --- a/oni-groovy.el +++ b/oni-groovy.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2022.0920.133859 +;; Version: 2022.0926.132722 ;; Package-Requires: (groovy-mode oni-embrace oni-smartparens groovy-imports rainbow-delimiters jenkinsfile-mode) ;; This program is free software; you can redistribute it and/or modify @@ -26,8 +26,9 @@ ;;; Code: -(require 'groovy-mode) (require 'groovy-imports) +(require 'groovy-mode) +(require 'smartparens) (defun oni-groovy--auto-fill-mode () "Enable ‘auto-fill-mode’ only for comments." @@ -66,6 +67,9 @@ (setq-local beginning-of-defun-function #'oni-groovy-beginning-of-defun end-of-defun-function #'oni-groovy-end-of-defun)) +(defun oni-groovy-setup-smartparens () + (sp-local-pair '(groovy-mode) "/" "/")) + (define-key groovy-mode-map (kbd "M-I") 'groovy-imports-add-import-dwim) (add-hook 'groovy-mode-hook #'oni-groovy-setup-defun-navigation) @@ -73,6 +77,7 @@ (add-hook 'groovy-mode-hook 'electric-indent-local-mode) (add-hook 'groovy-mode-hook 'groovy-imports-scan-file) (add-hook 'groovy-mode-hook 'oni-groovy--auto-fill-mode) +(add-hook 'groovy-mode-hook 'oni-groovy-setup-smartparens) (add-hook 'groovy-mode-hook 'rainbow-delimiters-mode) (add-hook 'groovy-mode-hook 'smartparens-mode)