I've been migrating from Vim to Emacs in evil mode, and I'd like to use smartparens. I know there's a port of surround.vim, but I've always found surround.vim awkward to use, so I'd like to explore an alternative approach.
I particularly like smartparens' take on wrapping -- select a region and type (
to wrap it in parens. This seems especially nice in concert with expand-region.
But in evil-visual-state, (
is bound to evil-backward-sentence-begin
. The binding originates in evil-motion-state-map, which both normal and visual states inherit from. I've tried a few ways to rebind (
to self-insert-command
in order to let smartparens do its thing, but so far nothing I've tried has worked:
(define-key evil-visual-state-map (kbd "(") 'self-insert-command)
(define-key evil-motion-state-map (kbd "(") 'self-insert-command)
(define-key evil-motion-state-map (kbd "(") nil)
(evil-define-key 'visual evil-visual-state-map (kbd "(") 'self-insert-command)
How can I properly configure this?
sp-self-insert-command
doesn't seem to exist, at least in the latest verison of smartparens. Is that something from an older version?