Fixed that single quotes should behave in Lisp modes.
This commit is contained in:
parent
e7a11e3640
commit
13cc881a2e
1 changed files with 18 additions and 3 deletions
|
@ -88,9 +88,9 @@ While I love packages that add functionality and I don’t have to learn anythin
|
||||||
#+end_src
|
#+end_src
|
||||||
And in case I need to call it directly:
|
And in case I need to call it directly:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun ha-goto-definition ()
|
(defun ha-goto-definition ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(evil-inner-WORD))
|
(evil-inner-WORD))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Clever Parenthesis
|
** Clever Parenthesis
|
||||||
We need to make sure we keep the [[https://github.com/Fuco1/smartparens][smartparens]] project always in /strict mode/, because who wants to worry about paren-matching:
|
We need to make sure we keep the [[https://github.com/Fuco1/smartparens][smartparens]] project always in /strict mode/, because who wants to worry about paren-matching:
|
||||||
|
@ -98,6 +98,21 @@ We need to make sure we keep the [[https://github.com/Fuco1/smartparens][smartpa
|
||||||
(use-package smartparens
|
(use-package smartparens
|
||||||
:custom
|
:custom
|
||||||
(smartparens-global-strict-mode t)
|
(smartparens-global-strict-mode t)
|
||||||
|
|
||||||
|
:config
|
||||||
|
(sp-with-modes sp-lisp-modes
|
||||||
|
;; disable ', as it's the quote character:
|
||||||
|
(sp-local-pair "'" nil :actions nil))
|
||||||
|
|
||||||
|
(sp-with-modes (-difference sp-lisp-modes sp-clojure-modes)
|
||||||
|
;; use the pseudo-quote inside strings where it serve as hyperlink.
|
||||||
|
(sp-local-pair "`" "'"
|
||||||
|
:when '(sp-in-string-p
|
||||||
|
sp-in-comment-p)
|
||||||
|
:skip-match (lambda (ms _mb _me)
|
||||||
|
(cond
|
||||||
|
((equal ms "'") (not (sp-point-in-string-or-comment)))
|
||||||
|
(t (not (sp-point-in-string-or-comment)))))))
|
||||||
:hook
|
:hook
|
||||||
(prog-mode . smartparens-strict-mode))
|
(prog-mode . smartparens-strict-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
Loading…
Reference in a new issue