1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:20:04 +08:00

Update lang#c layer

This commit is contained in:
wsdjeg 2017-12-03 23:21:00 +08:00
parent fe7776e8ba
commit 4a4b5e8fb6
2 changed files with 40 additions and 1 deletions

View File

@ -40,10 +40,16 @@
let s:use_libclang = 0
function! SpaceVim#layers#lang#c#plugins() abort
let plugins = []
if has('nvim')
call add(plugins, ['tweekmonster/deoplete-clang2'])
if s:use_libclang
call add(plugins, ['zchee/deoplete-clang'])
else
call add(plugins, ['tweekmonster/deoplete-clang2'])
endif
else
call add(plugins, ['Rip-Rip/clang_complete'])
endif
@ -56,6 +62,13 @@ function! SpaceVim#layers#lang#c#config() abort
call SpaceVim#mapping#space#regesit_lang_mappings('c', funcref('s:language_specified_mappings'))
endfunction
function! SpaceVim#layers#lang#c#set_variable(var) abort
" use clang or libclang
let s:use_libclang = get(a:var,
\ 'use_libclang',
\ 'clang')
endfunction
function! s:language_specified_mappings() abort
call SpaceVim#mapping#space#langSPC('nmap', ['l','r'],

26
docs/layers/lang/c.md Normal file
View File

@ -0,0 +1,26 @@
---
title: "SpaceVim lang#c layer"
description: "This layer is for c/c++/object-c development"
---
# [Layers](https://spacevim.org/layers) > lang#c
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Layer Installation](#layer-installation)
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
This layer is for c/c++/object-c development.
## Layer Installation
To use this configuration layer, add `SPLayer 'lang#java'` to your custom configuration file.
## Key bindings