Add cmake-ide to lang/c-c++ layer

This commit is contained in:
Alexander Dalshov 2017-08-14 10:54:15 +03:00 committed by syl20bnr
parent 937a7c3f0c
commit 690cf68315
2 changed files with 20 additions and 0 deletions

View File

@ -34,6 +34,9 @@ scripts.
company-clang (when =c-c++-enable-clang-support= is turned on), or
company-ycmd (when =ycmd= layer is included).
- Support for [[https://github.com/realgud/realgud][realgud]] debugger.
- Support for CMake configure/build (with limited support for other build systems),
automatic generation of =compile_commands.json= (compile flags), on-the-fly configuration
of flycheck, company-clang and RTags (if installed) with [[https://github.com/atilaneves/cmake-ide][cmake-ide]] .
* Install
** Layer
@ -112,6 +115,8 @@ doesn't complain about missing header files.
| ~SPC m g A~ | open matching file in another window (e.g. switch between .cpp and .h) |
| ~SPC m D~ | disaster: disassemble c/c++ code |
| ~SPC m r~ | srefactor: refactor thing at point. |
| ~SPC m p~ | Project / Build system management |
| ~SPC m c c~ | Compile project |
*Note:* [[https://github.com/tuhdo/semantic-refactor][semantic-refactor]] is only available for Emacs 24.4+

View File

@ -14,6 +14,7 @@
cc-mode
disaster
clang-format
cmake-ide
cmake-mode
company
(company-c-headers :requires company)
@ -43,7 +44,9 @@
(require 'compile)
(c-toggle-auto-newline 1)
(dolist (mode c-c++-modes)
(spacemacs/declare-prefix-for-mode mode "mc" "compile")
(spacemacs/declare-prefix-for-mode mode "mg" "goto")
(spacemacs/declare-prefix-for-mode mode "mp" "project/build system")
(spacemacs/set-leader-keys-for-major-mode mode
"ga" 'projectile-find-other-file
"gA" 'projectile-find-other-file-other-window)))))
@ -65,6 +68,18 @@
(when c-c++-enable-clang-format-on-save
(spacemacs/add-to-hooks 'spacemacs/clang-format-on-save c-c++-mode-hooks))))
(defun c-c++/init-cmake-ide ()
(use-package cmake-ide)
:config
(progn
(cmake-ide-setup)
(dolist (mode c-c++-modes)
(spacemacs/set-leader-keys-for-major-mode mode
"cc" 'cmake-ide-compile
"pc" 'cmake-ide-run-cmake
"pC" 'cmake-ide-maybe-run-cmake
"pd" 'cmake-ide-delete-file))))
(defun c-c++/init-cmake-mode ()
(use-package cmake-mode
:mode (("CMakeLists\\.txt\\'" . cmake-mode) ("\\.cmake\\'" . cmake-mode))))