spacemacs/layers/+lang/c-c++/config.el
Dela Anthonio 8e3a59dbfd
c-c++: Refactor to reduce duplication
Instead of repeating actions for c-mode and c++-mode and their respective hooks,
let loop through each mode or hook to reduce duplication.
2017-08-01 16:45:12 +03:00

32 lines
963 B
EmacsLisp

;;; config.el --- C/C++ Layer config File for Spacemacs
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; variables
(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.")
(defvar c-c++-enable-clang-support nil
"If non nil Clang related packages and configuration are enabled.")
(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.")
(spacemacs|define-jump-handlers c++-mode)
(spacemacs|define-jump-handlers c-mode)
(defvar c-c++-default-mode-for-headers 'c-mode
"Default mode to open header files. Can be `c-mode' or `c++-mode'.")