iliaRahbar
iliaRahbar

Reputation: 47

Vim complete option not worknig

I have complete=.,w,b,u,t,i. Using :h cpt you can find this:

i scan current and included files

I have the below c++ code:

#include <vector>
using namespace std;

int main()
{
    vector <int> v;

    v.push_
}

When I press C-n in front of v.push_ vim says -- Keyword completion (^N^P) Pattern not found.

How can I fix it?

I'm using vim 8.1 on ubuntu 20.04.

UPD:

:checkpath! output
--- Included files in path ---
<vector>  NOT FOUND
Press ENTER or type command to continue

Upvotes: 0

Views: 138

Answers (1)

r_31415
r_31415

Reputation: 8982

As @romainl pointed out, your path doesn't include your c++ directory in /usr/include/c++/, so you only need to add this directory to your path in your user runtime directory ~/.vim/after/ftplugin/cpp.vim. For example, this should be enough for your purposes as it will read files recursively based on the initial matches from your include command.

setlocal path=.,,/usr/include/c++/11/

You can also play with wildcards as described in :h file-searching.

Upvotes: 2

Related Questions