.
This commit is contained in:
parent
051092c4be
commit
126538bd89
1 changed files with 17 additions and 1 deletions
|
@ -540,6 +540,18 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(call-interactively #'forward-char)
|
(call-interactively #'forward-char)
|
||||||
(call-interactively #'paredit-newline))
|
(call-interactively #'paredit-newline))
|
||||||
|
|
||||||
|
(defun cc/slurp-forward ()
|
||||||
|
"Slurps forward when the key is after the closing paren."
|
||||||
|
(interactive)
|
||||||
|
(call-interactively #'backward-char)
|
||||||
|
(call-interactively #'paredit-forward-slurp-sexp))
|
||||||
|
|
||||||
|
(defun cc/barf-forward ()
|
||||||
|
"Barfs forward even when the key is after the closing paren."
|
||||||
|
(interactive)
|
||||||
|
(call-interactively #'backward-char)
|
||||||
|
(call-interactively #'paredit-forward-barf-sexp))
|
||||||
|
|
||||||
(defun looking-at-opening-paren ()
|
(defun looking-at-opening-paren ()
|
||||||
(looking-at (rx (or "(" "{" "["))))
|
(looking-at (rx (or "(" "{" "["))))
|
||||||
|
|
||||||
|
@ -570,7 +582,11 @@ Point must be at the beginning of balanced expression (sexp)."
|
||||||
(kbd "s") (conditional-keybind #'looking-at-opening-paren
|
(kbd "s") (conditional-keybind #'looking-at-opening-paren
|
||||||
#'cc/move-sexp-forward)
|
#'cc/move-sexp-forward)
|
||||||
(kbd "c") (conditional-keybind #'looking-at-opening-paren
|
(kbd "c") (conditional-keybind #'looking-at-opening-paren
|
||||||
#'cc/clone-sexp)))
|
#'cc/clone-sexp)
|
||||||
|
(kbd ">") (conditional-keybind #'being-past-closing-paren
|
||||||
|
#'cc/slurp-forward)
|
||||||
|
(kbd "<") (conditional-keybind #'being-past-closing-paren
|
||||||
|
#'cc/barf-forward)))
|
||||||
|
|
||||||
;; (use-package smartparens
|
;; (use-package smartparens
|
||||||
;; :delight (smartparens-mode " ")
|
;; :delight (smartparens-mode " ")
|
||||||
|
|
Loading…
Reference in a new issue