(Emacs)~Move smartparens and hook to text packages

This commit is contained in:
2020-09-21 22:12:33 +01:00
parent 3aa078733b
commit 706426dbb0

View File

@@ -1316,7 +1316,34 @@ Now, the binding
:states '(normal insert) :states '(normal insert)
(kbd "M-d") #'+text/delete-till-sentence) (kbd "M-d") #'+text/delete-till-sentence)
#+end_src #+end_src
** Programming packages *** Smartparens
Smartparens is a smarter electric-parens, it's much more aware of
stuff and easier to use.
#+begin_src emacs-lisp
(use-package smartparens
:hook
(prog-mode-hook . smartparens-mode)
(text-mode-hook . smartparens-mode)
:after evil
:config
(setq sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay t
sp-highlight-wrap-tag-overlay t)
(let ((unless-list '(sp-point-before-word-p
sp-point-after-word-p
sp-point-before-same-p)))
(sp-pair "'" nil :unless unless-list)
(sp-pair "\"" nil :unless unless-list))
(sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
(require 'smartparens-config))
#+end_src
*** Show-paren-mode
Show parenthesis for Emacs
#+begin_src emacs-lisp
(add-hook 'prog-mode-hook #'show-paren-mode)
#+end_src
** General Programming Configuration
*** Eldoc *** Eldoc
Eldoc presents documentation to the user upon placing ones cursor upon Eldoc presents documentation to the user upon placing ones cursor upon
any symbol. This is very useful when programming as it: any symbol. This is very useful when programming as it:
@@ -1560,34 +1587,6 @@ better than the default asterisks.
(use-package org-superstar (use-package org-superstar
:hook (org-mode-hook . org-superstar-mode)) :hook (org-mode-hook . org-superstar-mode))
#+end_src #+end_src
** Core text manipulation
*** Smartparens
Smartparens is a smarter electric-parens, it's much more aware of
stuff and easier to use.
#+begin_src emacs-lisp
(use-package smartparens
:hook
(prog-mode-hook . smartparens-mode)
(text-mode-hook . smartparens-mode)
:after evil
:config
(setq sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay t
sp-highlight-wrap-tag-overlay t)
(let ((unless-list '(sp-point-before-word-p
sp-point-after-word-p
sp-point-before-same-p)))
(sp-pair "'" nil :unless unless-list)
(sp-pair "\"" nil :unless unless-list))
(sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
(require 'smartparens-config))
#+end_src
*** Show-paren-mode
Show parenthesis for Emacs
#+begin_src emacs-lisp
(add-hook 'prog-mode-hook #'show-paren-mode)
#+end_src
** C/C++ ** C/C++
Setup for C and C++ modes via the cc-mode package. Setup for C and C++ modes via the cc-mode package.
*** Preamble *** Preamble