Emacs: rip out smartparens
Alan Pearce alan@alanpearce.eu
Sat, 07 Apr 2018 21:19:27 +0200
1 files changed, 3 insertions(+), 46 deletions(-)
jump to
M emacs/.emacs.d/main.el → emacs/.emacs.d/main.el
@@ -1597,13 +1597,7 @@ :config (progn (add-hook 'docker-compose-mode-hook #'company-mode-on))) (use-package nix-mode - :mode (("\\.nix\\'" . nix-mode)) - :config (progn - (define-hook-helper nix-mode () - (when (fboundp 'smartparens-mode) - (smartparens-strict-mode -1) - (smartparens-mode -1)) - (electric-pair-mode +1)))) + :mode (("\\.nix\\'" . nix-mode))) (define-derived-mode xmonad-mode haskell-mode "XM") (add-to-list 'auto-mode-alist '("xmobarrc\\'" . xmonad-mode)) @@ -1814,11 +1808,7 @@ org-journal-dir "~/Sync/Default/Documents/journal") (define-hook-helper org-journal-mode () (use-variable-fonts) - (text-scale-adjust 4) - (if (fboundp 'smartparens-strict-mode) - (smartparens-strict-mode -1)) - (if (fboundp 'show-smartparens-mode) - (show-smartparens-mode -1))) + (text-scale-adjust 4)) (defun org-journal-display-entry-yesterday () "Show org-journal entry for yesterday" (interactive) @@ -2223,7 +2213,7 @@ (use-package lsp-javascript-typescript :if (executable-find "javascript-typescript-langserver") :config (progn - (add-hook 'js2-mode-hook #'lsp-javascript-typescript-enable) + (remove-hook 'js2-mode-hook #'lsp-javascript-typescript-enable) (add-hook 'typescript-mode-hook #'lsp-javascript-typescript-enable))) ;;;;;; tern @@ -2643,39 +2633,6 @@ (add-hook 'lisp-mode-common-hook #'enable-paredit-mode) (put #'paredit-forward-delete 'delete-selection 'supersede) (put #'paredit-backward-delete 'delete-selection 'supersede) (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode))) - -;;;;; smartparens - -;; I like to use smartparens where paredit isn’t already useful. Somehow -;; I didn’t find smartparens’ implementation of paredit style to be as -;; nice as the real version - -(eval-when-compile (require 'smartparens nil :noerror)) -(use-package smartparens-config - :ensure smartparens - :config (progn - (sp-use-smartparens-bindings) - (setq sp-highlight-pair-overlay nil) - (fset 'wrap-with-paren "\C-](") ;; `sp-select-next-thing-exchange' - (bind-key "C-(" #'wrap-with-paren smartparens-mode-map) - (bind-key "C-)" #'sp-forward-slurp-sexp smartparens-mode-map) - (bind-key "M-<backspace>" #'backward-kill-word smartparens-mode-map) - (bind-key "M-?" #'sp-convolute-sexp smartparens-mode-map) - (bind-key "C-M-t" #'sp-transpose-sexp smartparens-mode-map) - (bind-key "M-R" #'sp-raise-sexp smartparens-mode-map) - (bind-key "M-S" #'sp-splice-sexp smartparens-mode-map) - (bind-key "C-M-s" #'sp-split-sexp smartparens-mode-map) - (bind-key "M-J" #'sp-join-sexp smartparens-mode-map) - (bind-key "M-<up>" #'sp-splice-sexp-killing-backward smartparens-mode-map) - (bind-key "M-<down>" #'sp-splice-sexp-killing-forward smartparens-mode-map) - (bind-key "C-M-S-k" #'sp-kill-hybrid-sexp smartparens-mode-map) - (bind-key "C-S-<right>" #'sp-slurp-hybrid-sexp smartparens-mode-map) - (show-smartparens-global-mode t) - (smartparens-global-strict-mode t) - (define-hook-helper lisp-mode-common () - (smartparens-strict-mode -1) - (smartparens-mode -1)))) - ;;;;; move-text