diff options
| -rw-r--r-- | jakob.org | 53 |
1 files changed, 52 insertions, 1 deletions
@@ -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 |