summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze2019-04-28 20:27:56 -0400
committerJakob L. Kreuze2019-04-28 20:27:56 -0400
commitea72dd89aa4ee2aa178ce1e5579439094e65cde8 (patch)
tree745bbaf7d05ec65ca9ed710513866ca773c586c2
parent8cf449f7fdf5103f7f308654c8089e31d5990ae1 (diff)
Add configuration for Smartparens
-rw-r--r--jakob.org53
1 files changed, 52 insertions, 1 deletions
diff --git a/jakob.org b/jakob.org
index f9222b2..da50e52 100644
--- a/jakob.org
+++ b/jakob.org
@@ -647,7 +647,10 @@ they look like."
;; erc
`(erc-input-face ((,class (:foreground ,white-1))))
- `(erc-button ((,class (:inherit link)))))
+ `(erc-button ((,class (:inherit link))))
+
+ ;; smartparens
+ `(sp-pair-overlay-face ((,class (:inherit default)))))
(custom-theme-set-variables
'chayote
@@ -1910,6 +1913,54 @@ Enable Projectile globally.
(projectile-mode +1))
#+END_SRC
+** Smartparens
+
+After several failed attempts at getting into Smartparens, I've finally
+developed a taste for it. Rommel was not lying when he said that "[i]t's like
+having cybernetic limbs—it makes you jump higher and punch harder."
+
+Use the default Smartparens configuration as a base.
+
+#+BEGIN_SRC elisp
+(use-package smartparens
+ :config
+ (require 'smartparens-config)
+#+END_SRC
+
+Enable Smartparens in all modes derived from =prog-mode=.
+
+#+BEGIN_SRC elisp
+ :hook
+ (prog-mode . turn-on-smartparens-mode)
+#+END_SRC
+
+Rebind the default keys for manipulating sexps to the alternatives suggested in
+[[https://ebzzry.io/en/emacs-pairs/][Emacs and Pairs]].
+
+#+BEGIN_SRC elisp
+ :bind
+ (:map smartparens-mode-map
+ ("C-M-a" . sp-beginning-of-sexp)
+ ("C-M-e" . sp-end-of-sexp)
+ ("C-M-d" . sp-down-sexp)
+ ("C-M-u" . sp-backward-up-sexp)
+ ("C-M-f" . sp-forward-sexp)
+ ("C-M-b" . sp-backward-sexp)
+ ("C-M-n" . sp-next-sexp)
+ ("C-M-p" . sp-previous-sexp)
+
+ ("M-[" . sp-backward-unwrap-sexp)
+ ("M-]" . sp-unwrap-sexp)
+ ("C-<right>" . sp-forward-slurp-sexp)
+ ("C-<left>" . sp-backward-slurp-sexp)
+ ("M-<right>" . sp-foward-barf-sexp)
+ ("M-<right>" . sp-forward-barf-sexp)
+
+ ("C-M-t" . sp-transpose-sexp)
+ ("C-M-k" . sp-kill-sexp)
+ ("M-k" . sp-backward-kill-sexp)))
+#+END_SRC
+
* Programming Languages
** Language Server Protocol

© 2015 - 2026 Jakob L. Kreuze