小编Jos*_*ros的帖子

Vim在C中自动完成一个结构

我正在尝试使用Vim自动完成功能.我有一个struct档案def.h:

typedef struct test{
        int x;
        int y;
}*test_p,test_t;
Run Code Online (Sandbox Code Playgroud)

并在相应的C文件中:

test_p t;
t->[autocomplete here]
Run Code Online (Sandbox Code Playgroud)

我应该用什么来填充x或y?从内部也CTRLP没有CTRLN给我变量test.

我已经习惯了ctags,当然我也包括在内def.h.这是我的标签文件中的内容:

test    def.h   /^typedef struct test{$/;"      s
test_p  def.h   /^}*test_p,test_t;$/;"  t       typeref:struct:test
test_t  def.h   /^}*test_p,test_t;$/;"  t       typeref:struct:test
x       def.h   /^      int x;$/;"      m       struct:test
y       def.h   /^      int y;$/;"      m       struct:test
Run Code Online (Sandbox Code Playgroud)

c vim autocomplete

8
推荐指数
1
解决办法
5419
查看次数

标签 统计

autocomplete ×1

c ×1

vim ×1