From 92073118b4f211003ae67fa3c48176445a074ebf Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Tue, 21 Jul 2020 09:41:31 -0400 Subject: [PATCH] Add keybindings to wrap stuff in quotes --- emacs/init.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 48409ca..192a900 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1439,12 +1439,20 @@ Smartparens enables structured editing of s-expressions and other pairs: :config (require 'smartparens-config) (show-smartparens-global-mode t) + (defun sp-wrap-double-quotes (&optional arg) + (interactive "P") + (sp-wrap-with-pair "\"")) + (defun sp-wrap-single-quotes (&optional arg) + (interactive "P") + (sp-wrap-with-pair "\'")) :general (prog-mode-map "C-c p" 'hydra-smartparens/body) (normal prog-mode-map "g p" 'hydra-smartparens/body) (normal "g[" 'sp-wrap-square) (normal "g(" 'sp-wrap-round) - (normal "g{" 'sp-wrap-curly)) + (normal "g{" 'sp-wrap-curly) + (normal "g\"" 'sp-wrap-double-quotes) + (normal "g\'" 'sp-wrap-single-quotes)) (use-package evil-smartparens :after (evil smartparens)