Autocomplete search word in vim

Sag*_*ain 2 vim autocomplete

How to autocomplete a search word in Vim?

I've the following piece of code and I want to search for the word pgnExists_f.

if(hj1939stack->pgnArray[index] == newPgn)
{
  /* newPgn already exists in the pgnArray */
  pgnExists_f = TRUE;
}
Run Code Online (Sandbox Code Playgroud)

In the search command I pressed TAB after typing pgn hoping that the word would autocomplete to pgnExists_f. But, what followed pgn was ^I.

/pgn[TAB] resulted in

/pgn^I
Run Code Online (Sandbox Code Playgroud)

Ken*_*ent 5

是的,有办法。

  • 这是常见的方法,将光标移到单词上pgnExists_f,然后按*或#

  • 使用命令行窗口。在正常模式下按q/,然后i插入模式,输入型pgn,那么ctrl-n还是ctrl-p你会看到弹出窗口,你可以选择你要搜索的词。