2015-11-15 12:21:53 +00:00
|
|
|
|
;;; config.el --- C/C++ Layer config File for Spacemacs
|
2015-04-01 02:24:01 +00:00
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-04-01 02:24:01 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
;;
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
;;
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2015-04-01 02:24:01 +00:00
|
|
|
|
|
|
|
|
|
;; variables
|
|
|
|
|
|
2018-12-11 21:59:25 +00:00
|
|
|
|
(spacemacs|define-jump-handlers c++-mode)
|
|
|
|
|
(spacemacs|define-jump-handlers c-mode)
|
|
|
|
|
|
2018-08-30 20:03:11 +00:00
|
|
|
|
(defvar c-c++-backend nil
|
2019-10-01 03:48:24 +00:00
|
|
|
|
"The backend to use for IDE features.
|
2020-04-02 16:16:36 +00:00
|
|
|
|
Possible values are `lsp-ccls', `lsp-clangd', `rtags' and `ycmd'.")
|
2019-09-30 04:49:44 +00:00
|
|
|
|
|
2019-10-01 02:11:20 +00:00
|
|
|
|
|
|
|
|
|
;; lsp
|
2016-03-31 19:36:56 +00:00
|
|
|
|
|
2019-10-01 03:48:24 +00:00
|
|
|
|
(defvar c-c++-lsp-enable-semantic-highlight nil
|
|
|
|
|
"If non-nil then enable semantic highlighting.
|
|
|
|
|
If `t' then regular semantic highlighting is enabled.
|
|
|
|
|
If `rainbow' then rainbow semantic highlighting is enabled.
|
|
|
|
|
Rainbow semantic highlighting gives a unique color to each identifier.")
|
2018-08-30 20:03:11 +00:00
|
|
|
|
|
2019-10-01 03:48:24 +00:00
|
|
|
|
(defvar c-c++-lsp-semantic-highlight-method 'font-lock
|
|
|
|
|
"Method used to highlight the text when semantic highlighting is enabled.
|
2018-08-30 20:03:11 +00:00
|
|
|
|
|
2019-10-01 03:48:24 +00:00
|
|
|
|
By default `font-lock' is used to highlight the text, set the variable to
|
|
|
|
|
`overlay' if you want to use overlays. Note that overlays can be slower.")
|
2019-10-01 02:11:20 +00:00
|
|
|
|
|
2021-01-20 14:33:17 +00:00
|
|
|
|
|
|
|
|
|
;; dap
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-dap-adapters '(dap-cpptools)
|
|
|
|
|
"Debug adapters to use for IDE debug features.
|
|
|
|
|
|
|
|
|
|
By default only `dap-cpptools' is used.
|
|
|
|
|
|
|
|
|
|
Add `dap-cpptools' for the official Microsoft C/C++ Extension for VSCode.
|
|
|
|
|
Add `dap-lldb' for the official LLDB project adapter.
|
|
|
|
|
Add `dap-gdb-lldb' for the WebFreak Native Debug extension.")
|
|
|
|
|
|
2019-10-01 02:11:20 +00:00
|
|
|
|
|
|
|
|
|
;; rtags
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-enable-rtags-completion t
|
|
|
|
|
"If `nil', RTags completion is disabled when the RTags backend is enabled.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; clang
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-enable-clang-format-on-save nil
|
|
|
|
|
"If non-nil, automatically format code with ClangFormat on
|
|
|
|
|
save. Clang support has to be enabled for this to work.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; style
|
|
|
|
|
|
|
|
|
|
(defvar c++-enable-organize-includes-on-save nil
|
|
|
|
|
"If non-nil then automatically organize the includes on save C++ buffer.")
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-enable-auto-newline nil
|
|
|
|
|
"If non nil then enables the `Auto-newline' minor mode.")
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-enable-google-style nil
|
|
|
|
|
"If non-nil `google-set-c-style' will be added as as
|
|
|
|
|
`c-mode-common-hook'.")
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-enable-google-newline nil
|
|
|
|
|
"If non-nil `google-make-newline-indent' will be added as as
|
|
|
|
|
`c-mode-common-hook'.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; misc
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-default-mode-for-headers (when (not (functionp 'c-or-c++-mode)) 'c-mode)
|
|
|
|
|
"Default mode to open header files. Can be `c-mode' or `c++-mode', or `c-or-c++-mode' for Emacs > 26+.")
|
|
|
|
|
|
|
|
|
|
(defvar c-c++-adopt-subprojects nil
|
|
|
|
|
"When non-nil, projectile will remember project root when visiting files in subprojects")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; internal
|
|
|
|
|
|
|
|
|
|
(defconst c-c++-modes '(c-mode c++-mode)
|
|
|
|
|
"Primary major modes of the `c-c++' layer.")
|
|
|
|
|
|
|
|
|
|
(defconst c-c++-mode-hooks '(c-mode-hook c++-mode-hook)
|
|
|
|
|
"Primary hooks of the `c-c++' layer.")
|