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:
parent
fe7776e8ba
commit
4a4b5e8fb6
@ -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
26
docs/layers/lang/c.md
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user