1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 23:10:04 +08:00
SpaceVim/docs/layers/lang/c.md
Chen Lijun e01c97049e Improve lang#c layer (#2440)
* Enhance c/c++ layer

* Update c/c++ layer documentation
2019-01-09 00:37:42 +08:00

1.8 KiB

title description
SpaceVim lang#c layer c/c++/object-c language support for SpaceVim, include code completion, jump to definition, quick runner.

Available Layers >> lang#c

Description

lang#c layer provides c/c++/object-c language support for SpaceVim.

Install

To use this configuration layer, update custom configuration file with:

[[layers]]
  name = "lang#c"

Features

  • code completion
  • syntax checking
  • formatting

Configuration

  • clang_executable (string)

Set the path to the clang executable

  • libclang_path (string)

The libclang shared object (dynamic library) file path. by default it is empty.

  • clang_std (dict)

A dict containing the standards you want to use. The default is:

{
    "c": "c11",
    "cpp": "c++1z",
    "objc": "c11",
    "objcpp": "c++1z",
}
  • clang_flag

Create a .clang file at your project root. You should be able to just paste most of your compile flags in there. You can also use a list ['-Iwhatever', ...] when loadding this layer.

here is an example how to use above options:

[[layers]]
  name = "lang#c"
  clang_executable = "/usr/bin/clang"
  [layer.clang_std]
    c = "c11"
    cpp = "c++1z"
    objc = "c11"
    objcpp = "c++1z"

Key bindings

key binding description
SPC l d show documentation
SPC l e rename symbol
SPC l f references
SPC l r compile and run current file
g d defintion preview