1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-24 12:26:05 -05:00

Clean up emacs parenthesis config

This commit is contained in:
Jack Foltz 2018-12-21 12:51:30 -05:00
parent e1d0fbe83e
commit b24d977b8b
Signed by: foltik
GPG Key ID: D1F0331758D1F29A

View File

@ -639,7 +639,7 @@ when idling on a completion candidate.
(use-package company-quickhelp (use-package company-quickhelp
:hook (company-mode . company-quickhelp-mode)) :hook (company-mode . company-quickhelp-mode))
#+END_SRC #+END_SRC
*** smartparens *** Smart Parentheses
smartparens handles parens for languages that aren't lispy, smartparens handles parens for languages that aren't lispy,
and paredit handles the rest. and paredit handles the rest.
Keybinds in =M-x sp-cheat-sheet=. Keybinds in =M-x sp-cheat-sheet=.
@ -651,16 +651,17 @@ Keybinds in =M-x sp-cheat-sheet=.
(use-package smartparens (use-package smartparens
:diminish :diminish
:commands smartparens-strict-mode :commands smartparens-strict-mode
:hook (prog-mode . foltz-paren-mode)
:config :config
(require 'smartparens-config)) (require 'smartparens-config))
(use-package evil-smartparens (use-package evil-smartparens
:commands evil-smartparens-mode
:hook (smartparens-enabled . evil-smartparens-mode)) :hook (smartparens-enabled . evil-smartparens-mode))
#+END_SRC
*** Smart Parentheses Modes
Picks a suitable parenthesis editing mode for the
current major mode when entering any prog-mode.
#+BEGIN_SRC emacs-lisp
(defun foltz-paren-mode () (defun foltz-paren-mode ()
"Enable a suitable paren editing mode for the current major mode"
(if (member major-mode (if (member major-mode
'(emacs-lisp-mode '(emacs-lisp-mode
lisp-mode lisp-mode
@ -668,6 +669,8 @@ Keybinds in =M-x sp-cheat-sheet=.
scheme-mode)) scheme-mode))
(enable-paredit-mode) (enable-paredit-mode)
(smartparens-strict-mode))) (smartparens-strict-mode)))
(add-hook 'prog-mode-hook #'foltz-paren-mode)
#+END_SRC #+END_SRC
*** evil-surround *** evil-surround
Use =S= and a delimiter to surround in visual mode. Use =S= and a delimiter to surround in visual mode.