lang/cc: fix default style in C/C++ modes
c-default-style wasn't being used correctly.
This commit is contained in:
parent
423c2958b6
commit
6b327dfcca
1 changed files with 7 additions and 7 deletions
|
@ -36,10 +36,6 @@ This is ignored by ccls.")
|
||||||
:commands (c-mode c++-mode objc-mode java-mode)
|
:commands (c-mode c++-mode objc-mode java-mode)
|
||||||
:mode ("\\.mm\\'" . objc-mode)
|
:mode ("\\.mm\\'" . objc-mode)
|
||||||
:init
|
:init
|
||||||
(setq-default c-basic-offset tab-width
|
|
||||||
c-backspace-function #'delete-backward-char
|
|
||||||
c-default-style "doom")
|
|
||||||
|
|
||||||
;; The plusses in c++-mode can be annoying to search for ivy/helm (which reads
|
;; The plusses in c++-mode can be annoying to search for ivy/helm (which reads
|
||||||
;; queries as regexps), so we add these for convenience.
|
;; queries as regexps), so we add these for convenience.
|
||||||
(defalias 'cpp-mode 'c++-mode)
|
(defalias 'cpp-mode 'c++-mode)
|
||||||
|
@ -85,9 +81,11 @@ This is ignored by ccls.")
|
||||||
(add-hook! '(c-mode-hook c++-mode-hook) #'+cc-fontify-constants-h)
|
(add-hook! '(c-mode-hook c++-mode-hook) #'+cc-fontify-constants-h)
|
||||||
|
|
||||||
;; Custom style, based off of linux
|
;; Custom style, based off of linux
|
||||||
|
(setq c-basic-offset tab-width
|
||||||
|
c-backspace-function #'delete-backward-char)
|
||||||
|
|
||||||
(c-add-style
|
(c-add-style
|
||||||
"doom" '((c-basic-offset . tab-width)
|
"doom" '((c-comment-only-line-offset . 0)
|
||||||
(c-comment-only-line-offset . 0)
|
|
||||||
(c-hanging-braces-alist (brace-list-open)
|
(c-hanging-braces-alist (brace-list-open)
|
||||||
(brace-entry-open)
|
(brace-entry-open)
|
||||||
(substatement-open after)
|
(substatement-open after)
|
||||||
|
@ -114,7 +112,9 @@ This is ignored by ccls.")
|
||||||
;; another level
|
;; another level
|
||||||
(access-label . -)
|
(access-label . -)
|
||||||
(inclass +cc-c++-lineup-inclass +)
|
(inclass +cc-c++-lineup-inclass +)
|
||||||
(label . 0)))))
|
(label . 0))))
|
||||||
|
|
||||||
|
(setf (alist-get 'other c-default-style) "doom"))
|
||||||
|
|
||||||
|
|
||||||
(use-package! modern-cpp-font-lock
|
(use-package! modern-cpp-font-lock
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue