Add keybindings to wrap stuff in quotes

This commit is contained in:
Jeremy Dormitzer 2020-07-21 09:41:31 -04:00
parent 87e099abb0
commit 92073118b4

View File

@ -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)