Move c electric disabler to config/default
Because it is tied to the smartparens config, and we'll want this behavior to extend to all C-derived modes (like csharp and php modes).
This commit is contained in:
parent
94b16cba6c
commit
9dd88e5924
2 changed files with 11 additions and 9 deletions
|
@ -64,6 +64,16 @@
|
|||
(sp-local-pair (append sp--html-modes '(markdown-mode gfm-mode))
|
||||
"<!--" "-->" :actions '(insert) :post-handlers '(("| " "SPC")))
|
||||
|
||||
;; Disable electric keys in C modes because it interferes with smartparens
|
||||
;; and custom bindings. We'll do it ourselves (mostly).
|
||||
(after! cc-mode
|
||||
(c-toggle-electric-state -1)
|
||||
(c-toggle-auto-newline -1)
|
||||
(setq c-tab-always-indent nil
|
||||
c-electric-flag nil)
|
||||
(dolist (key '("#" "{" "}" "/" "*" ";" "," ":" "(" ")" "\177"))
|
||||
(define-key c-mode-base-map key nil)))
|
||||
|
||||
;; Expand C-style doc comment blocks. Must be done manually because some of
|
||||
;; these languages use specialized (and deferred) parsers, whose state we
|
||||
;; can't access while smartparens is doing its thing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue