2015-12-02 14:23:39 +00:00
#+TITLE : C/C++ layer
2015-06-10 16:44:30 +00:00
2019-05-07 08:53:56 +00:00
#+TAGS : general|layer|multi-paradigm|programming
2019-05-05 17:26:40 +00:00
2015-06-10 16:44:30 +00:00
[[file:img/ccpp.jpg ]]
2019-05-07 20:05:06 +00:00
* Table of Contents :TOC_5_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#description ][Description ]]
2017-08-06 02:14:10 +00:00
- [[#features ][Features: ]]
2017-05-22 14:16:12 +00:00
- [[#install ][Install ]]
- [[#layer ][Layer ]]
- [[#default-mode-for-header-files ][Default mode for header files ]]
2018-08-30 20:03:11 +00:00
- [[#backends ][Backends ]]
- [[#rtags ][RTags ]]
- [[#external-dependencies ][External dependencies ]]
- [[#configuration ][Configuration ]]
2019-09-05 09:19:07 +00:00
- [[#lsp ][LSP ]]
- [[#features-1 ][Features ]]
2018-08-30 20:03:11 +00:00
- [[#external-dependencies-1 ][External dependencies ]]
2019-09-05 09:19:07 +00:00
- [[#clangd ][clangd ]]
2019-05-07 20:05:06 +00:00
- [[#ccls-server ][ccls server ]]
2019-09-05 09:19:07 +00:00
- [[#cquery-server ][cquery server ]]
2018-08-30 20:03:11 +00:00
- [[#configuration-1 ][Configuration ]]
2019-05-07 20:05:06 +00:00
- [[#basic ][Basic ]]
2019-09-05 09:19:07 +00:00
- [[#selecting-an-alternate-lsp-server ][Selecting an alternate LSP server ]]
2019-05-07 20:05:06 +00:00
- [[#setting-path-to-backend-executable ][Setting path to backend executable ]]
- [[#semantic-highlighting ][Semantic highlighting ]]
- [[#additional-configuration-options ][Additional configuration options ]]
- [[#example-dotspacemacs-configuration-layers-entry ][Example dotspacemacs-configuration-layers entry ]]
2018-08-30 20:03:11 +00:00
- [[#completion ][Completion ]]
2019-04-14 12:44:51 +00:00
- [[#debugger-dap-integration ][Debugger (dap integration) ]]
2019-05-10 17:40:06 +00:00
- [[#organize-file-header-includes-on-save ][Organize file header includes on save ]]
2017-08-01 15:36:18 +00:00
- [[#clang-configuration ][Clang Configuration ]]
2017-05-22 14:16:12 +00:00
- [[#clang-format ][clang-format ]]
- [[#company-clang-and-flycheck ][Company-clang and flycheck ]]
2016-03-31 19:36:56 +00:00
- [[#enable-google-set-c-style ][Enable google-set-c-style ]]
2018-05-15 20:54:03 +00:00
- [[#newlines ][Newlines ]]
2018-08-30 20:03:11 +00:00
- [[#projectile-sub-project-adoption ][Projectile sub-project adoption ]]
2018-12-05 03:03:03 +00:00
- [[#key-bindings ][Key bindings ]]
2017-08-01 15:36:18 +00:00
- [[#formatting-clang-format ][Formatting (clang-format) ]]
2018-08-30 20:03:11 +00:00
- [[#rtags-1 ][RTags ]]
2019-09-05 09:19:07 +00:00
- [[#lsp-1 ][LSP ]]
2018-08-30 20:03:11 +00:00
- [[#cquery--ccls ][cquery / ccls ]]
- [[#backend-language-server ][backend (language server) ]]
2018-11-22 10:56:35 +00:00
- [[#goto ][goto ]]
- [[#gotohierarchy ][goto/hierarchy ]]
- [[#gotomember ][goto/member ]]
2019-04-14 12:44:51 +00:00
- [[#debugger ][debugger ]]
2015-06-10 16:44:30 +00:00
* Description
2018-01-20 16:08:51 +00:00
This layer adds configuration for C/C++ language.
2015-06-10 16:44:30 +00:00
2017-08-06 02:14:10 +00:00
** Features:
2015-06-10 16:44:30 +00:00
- Support syntax checking via flycheck with Clang.
2015-07-27 22:04:39 +00:00
- Support for disassembly of code with [[https://github.com/jart/disaster ][disaster ]].
2015-06-10 16:44:30 +00:00
- Support code reformatting with [[http://clang.llvm.org/docs/ClangFormat.html ][clang-format ]].
2015-12-22 10:04:26 +00:00
- Display function or variable definition at the bottom. (when =semantic= layer
is included)
2015-06-10 21:16:01 +00:00
- Display current function cursor is in at the top. See [[https://github.com/tuhdo/semantic-stickyfunc-enhance ][stickyfunc-demos ]] for
demos in some programming languages. (when =semantic= layer is included)
2018-09-19 03:54:47 +00:00
- Support common refactoring with [[https://github.com/tuhdo/semantic-refactor ][semantic-refactor ]]. See [[https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos.org ][srefactor-demos ]] for
2015-06-10 21:16:01 +00:00
demonstration of refactoring features. (when =semantic= layer is included)
2015-12-22 10:04:26 +00:00
- Support code navigation via cscope (when =cscope= layer is included) and gtags.
- Support auto-completion (when =auto-completion= layer is included) via
company-clang (when =c-c++-enable-clang-support= is turned on), or
company-ycmd (when =ycmd= layer is included).
2017-05-14 17:20:10 +00:00
- Support for [[https://github.com/realgud/realgud ][realgud ]] debugger.
2018-01-20 16:08:51 +00:00
- Support for [[https://github.com/Andersbakken/rtags ][rtags ]].
2018-08-30 20:03:11 +00:00
- Support for [[https://github.com/cquery-project/cquery ][cquery ]] or [[https://github.com/MaskRay/ccls ][ccls ]] as an lsp backend.
2015-06-10 16:44:30 +00:00
* Install
** Layer
2016-01-06 05:21:55 +00:00
To use this configuration layer, add it to your =~/.spacemacs= . You will need to
add =c-c++= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-06-10 16:44:30 +00:00
2015-06-10 21:16:01 +00:00
*Note:* [[https://github.com/tuhdo/semantic-refactor ][semantic-refactor ]] is only available for Emacs 24.4+
2015-06-10 16:44:30 +00:00
** Default mode for header files
2019-08-15 23:21:00 +00:00
Mode for header files is auto detected by `c-or-c++-mode' in Emacs > 26.1+ .
Older Emacs will open header files in =c-mode= by default, you can open them in
=c++-mode= by setting the variable =c-c++-default-mode-for-headers= as follow.
2015-06-10 16:44:30 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
2018-08-30 20:03:11 +00:00
'((c-c++ :variables c-c+ +-default-mode-for-headers 'c+ +-mode)))
2015-06-10 16:44:30 +00:00
#+END_SRC
2015-06-10 21:16:01 +00:00
*Note:* To set the variable for a given project, create a directory local
2015-06-10 16:44:30 +00:00
variable at the root of your project. More info on directory local variables
can be found in the [[http://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Local-Variables.html ][dir-locals ]].
2018-08-30 20:03:11 +00:00
** Backends
2019-09-05 09:19:07 +00:00
This layer supports the selection of RTags, or one of three available implementations
of the [[https://github.com/Microsoft/language-server-protocol ][Language Server Protocol ]]
for code navigation etc. via the =c-c++-backend= configuration variable.
2018-08-30 20:03:11 +00:00
*** RTags
RTags is a well established clang-based source code indexing tool.
**** External dependencies
2019-09-30 04:49:44 +00:00
Install the RTags server via [[https://formulae.brew.sh/formula/rtags ][homebrew ]], the [[https://aur.archlinux.org/packages/rtags/ ][aur ]] or from source according to the
instructions [[https://github.com/Andersbakken/rtags ][here ]]. N.B. RTags is not supported on Windows at the time of
writing, although there is an [[https://github.com/Andersbakken/rtags/issues/770 ][open issue with some recent activity ]] on github.
2018-08-30 20:03:11 +00:00
**** Configuration
2018-11-11 21:12:06 +00:00
To enable support for =rtags= , set the layer variable =c-c++-backend= :
2018-08-30 20:03:11 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables c-c+ +-backend 'rtags)))
#+END_SRC
This will also enable =company-rtags= to be used as a backend for
auto-completion (when =auto-completion= layer is included).
To prevent this, while retaining the rest of Rtags functionality,
set the variable =c-c++-rtags-completion= to =nil= :
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables
c-c++-backend 'rtags
c-c++-enable-rtags-completion nil)))
#+END_SRC
2019-09-05 09:19:07 +00:00
*** LSP
LSP support is provided via the [[file:../../+tools/lsp/README.org ][LSP layer ]], using one of three available backends (all based on libclang).
- [[https://clang.llvm.org/extra/clangd/ ][clangd ]]
- [[https://github.com/cquery-project/cquery ][cquery ]]
- [[https://github.com/MaskRay/ccls ][ccls ]]
They claim to be more efficient than existing tools at indexing large code bases.
2018-08-30 20:03:11 +00:00
2019-09-05 09:19:07 +00:00
**** Features
2018-08-30 20:03:11 +00:00
- Cross references (definitions, references, base/derived classes/methods, type instances, ...)
- Diagnostics
- Completion with =company-lsp=
2019-09-05 09:19:07 +00:00
- Semantic highlighting (=cquery= , =ccls= )
2018-08-30 20:03:11 +00:00
- See more on [[https://github.com/cquery-project/cquery/wiki/Emacs ]]
2019-10-13 05:27:17 +00:00
- Cross-platform - functional on Windows, Linux and macOS.
2018-08-30 20:03:11 +00:00
**** External dependencies
2019-09-05 09:19:07 +00:00
Install one (or more) of the following (=clangd= is used by default) :
2018-08-30 20:03:11 +00:00
2019-09-05 09:19:07 +00:00
***** clangd
Install =clang= using a binary distribution downloaded from the [[http://releases.llvm.org/download.html ][LLVM releases page ]] or via your package manager.
This is the default implementation used by the emacs =lsp-mode= package and probably the easiest to install.
- [[https://clang.llvm.org/extra/clangd/Extensions.html ][clangd protocol extensions page ]]
2018-08-30 20:03:11 +00:00
***** ccls server
Install the =ccls= server. [[https://github.com/MaskRay/ccls/wiki/Getting-started ][Instructions ]].
2019-09-05 09:19:07 +00:00
This is currently the most fully featured implementation, including semantic highlighting and some navigation/
introspection features not provided by clangd.
***** cquery server
Install the =cquery= server. [[https://github.com/cquery-project/cquery/wiki/Getting-started ][Instructions ]].
This implementation appears to be unmaintained, and continued support is provided here purely for existing users.
2018-08-30 20:03:11 +00:00
**** Configuration
***** Basic
2019-09-05 09:19:07 +00:00
To use the default =clangd= language server, simply select =lsp= as the =c-c++= layer backend by adding the
2019-09-30 04:49:44 +00:00
following to your dotfile:
2018-08-30 20:03:11 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
2019-09-05 09:19:07 +00:00
'((c-c++ :variables c-c+ +-backend 'lsp)))
2018-08-30 20:03:11 +00:00
#+END_SRC
2019-09-05 09:19:07 +00:00
N.B. The [[file:../../+tools/lsp/README.org ][LSP layer ]] will be loaded automatically.
***** Selecting an alternate LSP server
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables c-c+ +-backend 'lsp c-c+ +-lsp-server 'ccls))) ; or 'cquery or 'clangd
#+END_SRC
2018-08-30 20:03:11 +00:00
***** Setting path to backend executable
2019-09-30 04:49:44 +00:00
The basic configuration above should work if the cquery/ccls executable folder
is present in your path. If not, you can set the path explicitly.
2018-08-30 20:03:11 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables
2019-09-05 09:19:07 +00:00
c-c++-backend 'lsp
c-c++-server 'ccls
c-c++-lsp-executable "/path/to/bin/ccls/clangd/or/cquery")))
2018-08-30 20:03:11 +00:00
#+END_SRC
If you need to expand =~= in the path, you can use =file-truename= like
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables
2019-09-05 09:19:07 +00:00
c-c++-backend 'lsp
c-c++-server 'ccls
c-c++-lsp-executable (file-truename "~/bin/clangd/ccls/or/cquery"))))
2018-08-30 20:03:11 +00:00
#+END_SRC
2019-09-05 09:19:07 +00:00
***** Semantic highlighting :ccls:cquery:
2019-09-30 04:49:44 +00:00
Semantic highlighting is disabled by default. To enable, set the
=c-c++-lsp-sem-highlight-method= variable to either ='font-lock= or ='overlay= .
To enable the rainbow semantic highlighting colour theme, set
=c-c++-lsp-sem-highlight-rainbow= to =t= .
2018-08-30 20:03:11 +00:00
2019-09-05 09:19:07 +00:00
***** Additional configuration options :ccls:cquery:
Both lsp backends are configured to store their index cache in a subdirectory of
=.emacs.d/cache= . This can be overridden by specifying an explicit
2019-09-30 04:49:44 +00:00
=c-c++-lsp-cache-dir= . Setting this value to a relative path will cause the
index cache to be placed in a subdirectory of your project root.
There are other initialization options such as the number of indexer threads,
2019-09-05 09:19:07 +00:00
cache serialization format. They have good default values. See =config.el= of
2019-09-30 04:49:44 +00:00
the layer and the backends' respective homepages for more info.
2018-08-30 20:03:11 +00:00
- [[https://github.com/MaskRay/ccls/wiki/Emacs ][Emacs section of =ccls= wiki ]]
2019-09-05 09:19:07 +00:00
- [[https://github.com/cquery-project/cquery/wiki/Emacs ][Emacs section of =cquery= wiki ]]
2018-08-30 20:03:11 +00:00
***** Example dotspacemacs-configuration-layers entry
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables
c-c++-adopt-subprojects t
2019-09-05 09:19:07 +00:00
c-c++-backend 'lsp
c-c++-server 'ccls
2018-08-30 20:03:11 +00:00
c-c++-lsp-executable (file-truename "~/dev/cpp/ccls/Release/ccls")
c-c++-lsp-sem-highlight-rainbow t)))
#+END_SRC
**** Completion
2019-09-30 04:49:44 +00:00
=company-lsp= provides completion functionality. Client-side cache and sorting
have been disabled in favour of server,
2018-08-30 20:03:11 +00:00
as recommended by =cquery= /=ccls= wikis.
2019-04-14 12:44:51 +00:00
**** Debugger (dap integration)
2019-09-30 04:49:44 +00:00
To install the debug adapter you may run =M-x dap-gdb-lldb-setup= when you are
on Linux or download it manually from [[https://marketplace.visualstudio.com/items?itemName=webfreak.debug ][Native Debug ]] and adjust
=dap-gdb-lldb-path= .
2019-04-14 12:44:51 +00:00
2019-05-10 17:40:06 +00:00
** Organize file header includes on save
To organize the file header includes on save, set the layer variable
=c++-enable-organize-includes-on-save= to =t= in the dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables c+ +-enable-organize-includes-on-save t)))
#+END_SRC
2017-08-01 15:36:18 +00:00
** Clang Configuration
To enable Clang support, set the layer variable =c-c++-enable-clang-support=
2015-06-10 16:44:30 +00:00
to =t= in the dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
2018-08-30 20:03:11 +00:00
'((c-c++ :variables c-c+ +-enable-clang-support t)))
2015-06-10 16:44:30 +00:00
#+END_SRC
2018-08-30 20:03:11 +00:00
N.B. do not set this option if either the =cquery= or =ccls= backend
2015-06-10 16:44:30 +00:00
*** clang-format
[[http://clang.llvm.org/docs/ClangFormat.html ][clang-format ]] allows reformatting either a selected region of code
2017-08-01 15:36:18 +00:00
(=clang-format-region= ) or a whole buffer (=clang-format-buffer= )
according to a style defined in a =.clang-format= file. This file
is either located in the same directory as the file being edited,
or any of its parent directories. If no =.clang-format= is found,
then a default style will be used.
2015-06-10 16:44:30 +00:00
2017-04-07 09:21:05 +00:00
To enable automatic buffer formatting on save, set the variable
=c-c++-enable-clang-format-on-save= to =t= :
#+BEGIN_SRC emacs-lisp
2018-08-30 20:03:11 +00:00
(setq-default dotspacemacs-configuration-layers
'((c-c++ :variables c-c+ +-enable-clang-format-on-save t)))
2017-04-07 09:21:05 +00:00
#+END_SRC
2015-06-10 16:44:30 +00:00
*** Company-clang and flycheck
2017-08-28 02:18:53 +00:00
This layer adds some fancy improvements to =company-clang= . It includes a hook
to load a projects =.clang_complete= file, which is just a text file with one
clang flag per line, a format also used by other text editor clang plugins.
2015-06-10 16:44:30 +00:00
2017-08-28 02:18:53 +00:00
Not only does this allow proper autocomplete on projects with extra includes and
2019-05-26 20:58:52 +00:00
flags, but there is also support for flycheck so that it doesn't complain about
2017-08-28 02:18:53 +00:00
missing header files.
2015-06-10 16:44:30 +00:00
2016-03-31 19:36:56 +00:00
** Enable google-set-c-style
If you have clang enabled with =clang-format= as described earlier in this page
you may not have a lot of neeed for =google-set-c-style= if you are already
using a mode based on Google mode for most of your projects.
2019-05-26 20:58:52 +00:00
However, if you don't have (or want) =clang-format= , or if you have to do a lot
[[https://www.emacswiki.org/emacs/TrampMode ][Tramp ]] remote editing on systems that don't have =clang-format= installed, you
2016-03-31 19:36:56 +00:00
may want =google-c-style= enabled and added to your common hooks.
To get =google-c-style= actually install itself into your C/C++ common hooks,
you need to have =c-c++-enable-google-style= defined to true when you load the
C-C++ lang in Spacemacs. In your =~/.spacemacs= file, a possible way that this
would look is that in your list of =dostpacemacs-configuration-layers= you have
an entry like
#+BEGIN_SRC emacs-lisp
2018-11-09 21:04:48 +00:00
(c-c++ :variables c-c+ +-enable-google-style t)
#+END_SRC
2016-03-31 19:36:56 +00:00
Additionally, if you have =c-c++-enable-google-newline= variable set then
=`google-make-newline-indent= will be set as a =c-mode-common-hook= . You would
set that up like this:
#+BEGIN_SRC emacs-lisp
2018-11-09 21:04:48 +00:00
(c-c++ :variables c-c+ +-enable-google-style t
c-c++-enable-google-newline t)
#+END_SRC
2016-03-31 19:36:56 +00:00
2018-05-15 20:54:03 +00:00
** Newlines
You can enable the =Auto-newline= minor mode that automatically adds newlines
2018-05-24 02:12:30 +00:00
after certain characters by setting the =c-c++-enable-auto-newline= variable.
2018-05-15 20:54:03 +00:00
#+BEGIN_SRC emacs-lisp
2018-11-09 21:04:48 +00:00
(c-c++ :variables c-c+ +-enable-auto-newline t)
#+END_SRC
2018-05-15 20:54:03 +00:00
2018-08-30 20:03:11 +00:00
** Projectile sub-project adoption
To prevent projectile from using subproject root when visiting files in a subproject,
set =c-c++-adopt-subprojects= to =t= .
#+BEGIN_SRC emacs-lisp
2018-11-09 21:04:48 +00:00
(c-c++ :variables c-c+ +-adopt-subprojects t)
#+END_SRC
2018-08-30 20:03:11 +00:00
This is based on a recommendation on the =cquery= and =ccls= wikis, but should be more
generally applicable.
2018-12-05 03:03:03 +00:00
* Key bindings
2015-06-10 16:44:30 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-01-20 16:08:51 +00:00
|-------------+---------------------------------------------------------------|
| ~SPC m g a~ | open matching file |
| | (e.g. switch between .cpp and .h, requires a project to work) |
| ~SPC m g A~ | open matching file in another window |
| | (e.g. switch between .cpp and .h, requires a project to work) |
| ~SPC m D~ | disaster: disassemble c/c++ code |
2018-08-30 20:03:11 +00:00
| ~SPC m r .~ | srefactor: refactor thing at point. |
2019-05-10 17:40:06 +00:00
| ~SPC m r i~ | organize includes |
2015-06-10 16:44:30 +00:00
2018-09-19 03:54:47 +00:00
*Note:* [[https://github.com/tuhdo/semantic-refactor ][semantic-refactor ]] is only available for Emacs 24.4+.
2017-05-14 17:20:10 +00:00
2017-08-01 15:36:18 +00:00
** Formatting (clang-format)
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2017-08-01 15:36:18 +00:00
|-------------+---------------------------------|
| ~SPC m = =~ | format current region or buffer |
| ~SPC m = f~ | format current function |
2018-01-06 07:44:33 +00:00
** RTags
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-01-06 07:44:33 +00:00
|-------------+---------------------------------|
| ~SPC m g .~ | find symbol at point |
| ~SPC m g ,~ | find references at point |
| ~SPC m g ;~ | find file |
| ~SPC m g /~ | find all references at point |
| ~SPC m g [~ | location stack back |
| ~SPC m g ]~ | location stack forward |
| ~SPC m g >~ | c++ tags find symbol |
| ~SPC m g <~ | c++ tags find references |
| ~SPC m g B~ | show rtags buffer |
| ~SPC m g d~ | print dependencies |
| ~SPC m g D~ | diagnostics |
| ~SPC m g e~ | reparse file |
| ~SPC m g E~ | preprocess file |
| ~SPC m g F~ | fixit |
| ~SPC m g G~ | guess function at point |
| ~SPC m g h~ | print class hierarchy |
| ~SPC m g I~ | c++ tags imenu |
| ~SPC m g L~ | copy and print current location |
| ~SPC m g M~ | symbol info |
| ~SPC m g O~ | goto offset |
| ~SPC m g p~ | set current project |
| ~SPC m g R~ | rename symbol |
| ~SPC m g s~ | print source arguments |
| ~SPC m g S~ | display summary |
| ~SPC m g T~ | taglist |
| ~SPC m g v~ | find virtuals at point |
| ~SPC m g V~ | print enum value at point |
| ~SPC m g X~ | fix fixit at point |
| ~SPC m g Y~ | cycle overlays on screen |
2018-08-30 20:03:11 +00:00
2019-09-05 09:19:07 +00:00
** LSP
The default key bindings for LSP implementations are defined by/documented in the [[file:../ ../+tools/lsp/README.org][LSP layer]].
2018-08-30 20:03:11 +00:00
** cquery / ccls
2019-09-05 09:19:07 +00:00
The key bindings listed below are in addition to
2018-11-22 10:56:35 +00:00
A ~[ccls]~ or ~[cquery]~ suffix indicates that the binding is for the indicated backend only.
*** backend (language server)
2018-12-22 11:04:49 +00:00
| Key binding | Description |
2018-11-22 10:56:35 +00:00
|-------------+------------------------------------------|
| ~SPC m b f~ | refresh index (e.g. after branch change) |
| ~SPC m b p~ | preprocess file |
2018-08-30 20:03:11 +00:00
*** goto
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2018-08-30 20:03:11 +00:00
|-------------+---------------------------|
| ~SPC m g &~ | find references (address) |
| ~SPC m g R~ | find references (read) |
| ~SPC m g W~ | find references (write) |
| ~SPC m g c~ | find callers |
2018-11-09 18:25:27 +00:00
| ~SPC m g C~ | find callees |
2018-08-30 20:03:11 +00:00
| ~SPC m g v~ | vars |
2018-11-22 10:56:35 +00:00
| ~SPC m g f~ | find file at point (ffap) |
| ~SPC m g F~ | ffap other window |
**** goto/hierarchy
2018-12-22 11:04:49 +00:00
| Key binding | Description |
2018-11-22 10:56:35 +00:00
|---------------+-----------------------------|
| ~SPC m g h b~ | base class(es) |
| ~SPC m g h d~ | derived class(es) [ccls] |
| ~SPC m g h c~ | call hierarchy |
| ~SPC m g h C~ | call hierarchy (inv) |
| ~SPC m g h i~ | inheritance hierarchy |
| ~SPC m g h I~ | inheritance hierarchy (inv) |
**** goto/member
2018-12-22 11:04:49 +00:00
| Key binding | Description |
|---------------+-------------------------|
| ~SPC m g m h~ | member hierarchy |
| ~SPC m g m t~ | member types [ccls] |
| ~SPC m g m f~ | member functions [ccls] |
| ~SPC m g m v~ | member variables [ccls] |
2019-04-14 12:44:51 +00:00
** debugger
| Key binding | Description |
|---------------+---------------------------------|
| ~SPC m d d d~ | start debugging |
| ~SPC m d d l~ | debug last configuration |
| ~SPC m d d r~ | debug recent configuration |
|---------------+---------------------------------|
| ~SPC m d c~ | continue |
| ~SPC m d i~ | step in |
| ~SPC m d o~ | step out |
| ~SPC m d s~ | next step |
| ~SPC m d v~ | inspect value at point |
| ~SPC m d r~ | restart frame |
|---------------+---------------------------------|
| ~SPC m d .~ | debug transient state |
|---------------+---------------------------------|
| ~SPC m d a~ | abandon current session |
| ~SPC m d A~ | abandon all process |
|---------------+---------------------------------|
| ~SPC m d e e~ | eval |
| ~SPC m d e r~ | eval region |
| ~SPC m d e t~ | eval value at point |
|---------------+---------------------------------|
| ~SPC m d S s~ | switch session |
| ~SPC m d S t~ | switch thread |
| ~SPC m d S f~ | switch frame |
|---------------+---------------------------------|
| ~SPC m d I i~ | inspect |
| ~SPC m d I r~ | inspect region |
| ~SPC m d I t~ | inspect value at point |
|---------------+---------------------------------|
| ~SPC m d b b~ | toggle a breakpoint |
| ~SPC m d b c~ | change breakpoint condition |
| ~SPC m d b l~ | change breakpoint log condition |
| ~SPC m d b h~ | change breakpoint hit count |
| ~SPC m d b a~ | add a breakpoint |
| ~SPC m d b d~ | delete a breakpoint |
| ~SPC m d b D~ | clear all breakpoints |
|---------------+---------------------------------|
| ~SPC m d '_~ | Run debug REPL |
|---------------+---------------------------------|
| ~SPC m d w l~ | list local variables |
| ~SPC m d w o~ | goto output buffer if present |
| ~SPC m d w s~ | list sessions |
| ~SPC m d w b~ | list breakpoints |