Move C/C++ and CMake to c-c++ layer
Although CMake can support different compilers it is mainly used for C++ projects. So it makes sense to add it here.
This commit is contained in:
parent
c70c75231b
commit
61a9481e96
30
contrib/lang/c-c++/README.md
Normal file
30
contrib/lang/c-c++/README.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
# C/C++ contribution layer for Spacemacs
|
||||
|
||||
![cc++](ccpp.png)
|
||||
![cmake](cmake.png)
|
||||
|
||||
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
||||
**Table of Contents**
|
||||
|
||||
- [C/C++ contribution layer for Spacemacs](#cc-contribution-layer-for-spacemacs)
|
||||
- [Description](#description)
|
||||
- [Install](#install)
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
## 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/
|
BIN
contrib/lang/c-c++/ccpp.jpg
Normal file
BIN
contrib/lang/c-c++/ccpp.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
contrib/lang/c-c++/cmake.png
Normal file
BIN
contrib/lang/c-c++/cmake.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
24
contrib/lang/c-c++/packages.el
Normal file
24
contrib/lang/c-c++/packages.el
Normal file
|
@ -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))))
|
|
@ -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 --------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue