lang/cc: move smartparens config to config/default

This commit is contained in:
Henrik Lissner 2019-05-22 03:50:53 -04:00
parent 87144d3c0c
commit 3474e6bf09
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 15 additions and 16 deletions

View file

@ -112,21 +112,7 @@ This is ignored by ccls.")
;; another level
(access-label . -)
(inclass +cc-c++-lineup-inclass +)
(label . 0))))
;;; Keybindings
;; Smartparens and cc-mode both try to autoclose angle-brackets intelligently.
;; The result isn't very intelligent (causes redundant characters), so just do
;; it ourselves.
(define-key! c++-mode-map "<" nil ">" nil)
;; ...and leave it to smartparens
(sp-with-modes '(c++-mode objc-mode)
(sp-local-pair "<" ">"
:when '(+cc-sp-point-is-template-p +cc-sp-point-after-include-p)
:post-handlers '(("| " "SPC"))))
(sp-with-modes '(c-mode c++-mode objc-mode java-mode)
(sp-local-pair "/*!" "*/" :post-handlers '(("||\n[i]" "RET") ("[d-1]< | " "SPC")))))
(label . 0)))))
(def-package! modern-cpp-font-lock