diff --git a/contrib/lang/c-c++/README.md b/contrib/lang/c-c++/README.md new file mode 100644 index 000000000..c5428e35b --- /dev/null +++ b/contrib/lang/c-c++/README.md @@ -0,0 +1,30 @@ +# C/C++ contribution layer for Spacemacs + +![cc++](ccpp.png) +![cmake](cmake.png) + + +**Table of Contents** + +- [C/C++ contribution layer for Spacemacs](#cc-contribution-layer-for-spacemacs) + - [Description](#description) + - [Install](#install) + + + +## Description + +This layer adds configuration for C/C++ language as well support for [CMake][] +scripts. + +## Install + +To use this contribution add it to your `~/.spacemacs` + +```elisp +(setq-default dotspacemacs-configuration-layers '(c-c++) + "List of contribution to load." +) +``` + +[CMake]: http://www.cmake.org/ diff --git a/contrib/lang/c-c++/ccpp.jpg b/contrib/lang/c-c++/ccpp.jpg new file mode 100644 index 000000000..0a39aa98a Binary files /dev/null and b/contrib/lang/c-c++/ccpp.jpg differ diff --git a/contrib/lang/c-c++/cmake.png b/contrib/lang/c-c++/cmake.png new file mode 100644 index 000000000..c9baf1367 Binary files /dev/null and b/contrib/lang/c-c++/cmake.png differ diff --git a/contrib/lang/c-c++/packages.el b/contrib/lang/c-c++/packages.el new file mode 100644 index 000000000..c8951d22b --- /dev/null +++ b/contrib/lang/c-c++/packages.el @@ -0,0 +1,24 @@ +(defvar c-c++-packages + '( + cc-mode + cmake-mode + ) + "List of all packages to install and/or initialize. Built-in packages +which require an initialization must be listed explicitly in the list.") + +(defun c-c++/init-cc-mode () + (use-package cc-mode + :defer t + :config + (progn + (add-hook 'c-mode-hook '(lambda () (c-toggle-auto-state t))) + (add-hook 'c++-mode-hook '(lambda () (c-toggle-auto-state t)))))) + +(defun c-c++/init-cmake-mode () +(use-package cmake-mode + :defer t + :init + (setq auto-mode-alist + (append '(("CMakeLists\\.txt\\'" . cmake-mode) + ("\\.cmake\\'" . cmake-mode)) + auto-mode-alist)))) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 538c98d81..769f08704 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -10,8 +10,6 @@ auto-highlight-symbol bookmark buffer-move - cc-mode - cmake-mode dash diminish dired+ @@ -444,23 +442,6 @@ which require an initialization must be listed explicitly in the list.") "bmk" 'buf-move-up "bml" 'buf-move-right))) -(defun spacemacs/init-cc-mode () - (use-package cc-mode - :defer t - :config - (progn - (add-hook 'c-mode-hook '(lambda () (c-toggle-auto-state t))) - (add-hook 'c++-mode-hook '(lambda () (c-toggle-auto-state t)))))) - -(defun spacemacs/init-cmake-mode () -(use-package cmake-mode - :defer t - :init - (setq auto-mode-alist - (append '(("CMakeLists\\.txt\\'" . cmake-mode) - ("\\.cmake\\'" . cmake-mode)) - auto-mode-alist)))) - (defun spacemacs/init-diminish () (require 'diminish) ;; Minor modes abbrev --------------------------------------------------------