Skip to content

Instantly share code, notes, and snippets.

@saevarb
Created October 15, 2016 20:05
Show Gist options
  • Save saevarb/699086894abb1b92512050ae74661462 to your computer and use it in GitHub Desktop.
Save saevarb/699086894abb1b92512050ae74661462 to your computer and use it in GitHub Desktop.
(setq-local sbrg:pairs
'(("(" . ")")
("[" . "]")
("{" . "}")
("\"")
("\'")
))
(dolist (pair sbrg:pairs)
(let* ((lhs (car pair)) (rhs (cdr pair)) fn)
(defun do-wrap (arg)
(interactive)
(sp-wrap-with-pair arg)
)
;; (message (format "%S" lhs))
;; (message (format "%S" rhs))
(define-key evil-visual-state-map (kbd lhs) (lambda () (interactive) (do-wrap lhs)))
(when rhs
(define-key evil-visual-state-map (kbd rhs) (lambda () (interactive) (do-wrap rhs)))
)
)
)
;; asdfasdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment