Clang Complete for Vim

后端 未结 5 972
盖世英雄少女心
盖世英雄少女心 2021-01-30 14:53

I copied clang_complete.vim to plugin, but when I typed . after some variable, it says:

pattern not found

5条回答
  •  Happy的楠姐
    2021-01-30 15:31

    Try opening a sample file

    vim /tmp/sample.cpp
    

    and enter some cpp code

    #include 
    
    int main() {
      std:: // <-- this should complete
    }
    

    Note that you actually need to include the headers, since completion is done with the compiler. If this works, but your project still keeps saying "Pattern not found" then clang++ is probably not able to compile your project. Do you use any -I switches when you compile your code? Add them to a file named .clang_complete in your project directory.

    For me this works fine with my .vim/plugin folder containing only the clang_complete.vim file that is available for download:

    $ find .vim
    .vim
    .vim/plugin
    .vim/plugin/clang_complete.vim
    

    ... but in this issue report https://github.com/Rip-Rip/clang_complete/issues/39 it is suggested that you might need more than that file (additional files are in the git repo).

提交回复
热议问题