title: Vim autocomplete a struct in C
body: <p>I'm trying to use Vim autocomplete. I've got a <code>struct</code> in file <code>def.h</code>:</p>
  
  <pre><code>typedef struct test{
          int x;
          int y;
  }*test_p,test_t;
  </code></pre>
  
  <p>And in the corresponding C file:</p>
  
  <pre><code>test_p t;
  t-&gt;[autocomplete here]
  </code></pre>
  
  <p>What i should press to fill it with x or y? Neither <kbd>CTRL</kbd><kbd>P</kbd> nor <kbd>CTRL</kbd><kbd>N</kbd> give me variables from inside <code>test</code>.</p>
  
  <p>I've already used <code>ctags</code> and of course I've included <code>def.h</code>. Here is what is in my tags file:</p>
  
  <pre><code>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
  </code></pre>