diff options
author | David Morgan <djm_uk@protonmail.com> | 2023-06-19 13:08:56 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2023-06-19 13:08:56 +0100 |
commit | 361056268e4ac40fc530bed9e40a320fd2ab63c8 (patch) | |
tree | a5960d206f747a232417b96ac443cc169fa17b1d | |
parent | 408d6f1bedf03dcaea163ad271a41ae460ac6e95 (diff) | |
download | dotfiles-361056268e4ac40fc530bed9e40a320fd2ab63c8.tar.gz |
Use sp-{for,back}ward-sexp wrappers instead of sp-{beginning,end}-of-sexp
-rw-r--r-- | .emacs.d/lisp/init-smartparens.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/.emacs.d/lisp/init-smartparens.el b/.emacs.d/lisp/init-smartparens.el index 571fef3..3b8729e 100644 --- a/.emacs.d/lisp/init-smartparens.el +++ b/.emacs.d/lisp/init-smartparens.el @@ -74,12 +74,24 @@ Equivalent to raising then wrapping." nil t) (apply origin args))) (advice-add 'sp-mark-sexp :around 'sp-mark-sexp-advice) + (defun sp-fwd-sexp (arg) + (interactive "^P") + (if (sp--raw-argument-p arg) + (sp-end-of-sexp) + (call-interactively 'sp-forward-sexp arg))) + (defun sp-bwd-sexp (arg) + (interactive "^P") + (if (sp--raw-argument-p arg) + (sp-beginning-of-sexp) + (call-interactively 'sp-backward-sexp arg))) (unbind-key "M-?" 'smartparens-mode-map) (unbind-key "M-?" 'sp-keymap) :bind (:map smartparens-mode-map ("C-M-?" . sp-convolute-sexp) ([remap mark-sexp] . sp-mark-sexp) ([remap kill-sexp] . sp-kill-sexp) + ([remap sp-forward-sexp] . sp-fwd-sexp) + ([remap sp-backward-sexp] . sp-bwd-sexp) ("M-[" . sp-wrap-square) ("C-c M-{" . sp-wrap-curly) ("M-W" . sp-copy-sexp) @@ -90,10 +102,6 @@ Equivalent to raising then wrapping." ("M-;" . paredit-comment-dwim) ("M-q" . sp-indent-defun) ("C-j" . sp-newline) - ("C-S-a" . sp-beginning-of-sexp) - ("M-A" . sp-beginning-of-sexp) - ("C-S-e" . sp-end-of-sexp) - ("M-E" . sp-end-of-sexp) ("M-R" . kill-around-sexp) ("C-c C-S-d" . duplicate-sexp-after-point) ("C-c M-(" . wrap-round-from-behind))) |