asyncomplete-clang.vim


Ⅰ. 插件描述

C/C++ support for asyncomplete.vim

Ⅱ. 基本信息

创建日期:  2017-08-29
使用用户:  2
Github星:  6
插件作者:  keremc

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'keremc/asyncomplete-clang-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'keremc/asyncomplete-clang-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'keremc/asyncomplete-clang-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/keremc/asyncomplete-clang.vim

Ⅳ. 文档说明

# asyncomplete-clang.vim

NOT READY FOR GENERAL USE!

Provide C, C++, Objective-C and Objective-C++ support for asyncomplete.vim.

Requirements

  • Vim 8 or Neovim
  • Clang
  • async.vim and asyncomplete.vim

Installation

  • Install this plugin with your preferred Vim plugin manager.
  • Append your Vim configuration file:
autocmd User asyncomplete_setup call asyncomplete#register_source(
    \ asyncomplete#sources#clang#get_source_options())

Configuration

This plugin can be further configured by passing a dictionary to asyncomplete#sources#clang#get_source_options() like this:

autocmd User asyncomplete_setup call asyncomplete#register_source(
    \ asyncomplete#sources#clang#get_source_options({
    \     'config': {
    \         'clang_path': '/opt/llvm/bin/clang',
    \         'clang_args': {
    \             'default': ['-I/opt/llvm/include'],
    \             'cpp': ['-std=c++11', '-I/opt/llvm/include']
    \         }
    \     }
    \ }))
OptionExplanation
config.clang_pathPath to the clang binary. If clang cannot be found in PATH, you must specify this manually.
config.clang_argsMap where the key is a file type name and its value is a list of Clang arguments to be used with that file type. If there is no entry for a particular file type, 'default' is used instead.

.clang_complete

Should you wish to pass extra arguments to Clang, you can create a file named .clang_complete in the root directory of your project. Each line in this file will be treated as a single argument and the directory in which .clang_complete resides will be used as the working directory (for Clang).

Example:

-std=c++14
-I/usr/local/include
-I/usr/include

License

See LICENSE.

添加新评论