Giter Club home page Giter Club logo

ncm2-pyclang's Introduction

Introduction

C/C++ code completion plugin for ncm2

This plugin is based on libclang python binding. Inspired by clang_complete.

Config

g:ncm2_pyclang#library_path

Use g:ncm2_pyclang#library_path to specify the directory of libclang library or the file itself, e.g., for Linux:

" path to directory where libclang.so can be found
let g:ncm2_pyclang#library_path = '/usr/lib/llvm-5.0/lib'

" or path to the libclang.so file
let g:ncm2_pyclang#library_path = '/usr/lib64/libclang.so.5.0'

Notes:

  • Different operating systems normally have their own extensions for the libclang file.

    • Linux: libclang.so
    • macOS: libclang.dylib
    • Windows: libclang.dll
  • Sometimes ncm2-pyclang still works even you don't set g:ncm2_pyclang#library_path, that's because another libclang is found, which is probably the system libclang. The system libclang is often a bit old and is not guranteed to always be found, so I highly recommend set g:ncm_clang#library_path explicitly.

g:ncm2_pyclang#database_path

" a list of relative paths for compile_commands.json
let g:ncm2_pyclang#database_path = [
            \ 'compile_commands.json',
            \ 'build/compile_commands.json'
            \ ]

g:ncm2_pyclang#args_file_path

If your build system doesn't generate compile_commands.json, you could put a .clang_complete file into your project directory, which sould contain something like:

-DDEBUG
-include ../config.h
-I../common
" a list of relative paths looking for .clang_complete
let g:ncm2_pyclang#args_file_path = ['.clang_complete']

g:ncm2_pyclang#clang_path

This option defaults to clang. clang is invoked with clang -### to find all the include directories used by clang, so that this plugin could provide accurate include completion.

Goto Declaration

    autocmd FileType c,cpp nnoremap <buffer> gd :<c-u>call ncm2_pyclang#goto_declaration()<cr>

ncm2-pyclang's People

Contributors

ilya-biryukov avatar liuchengxu avatar roxma avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.