Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It seems like I do not understand how to make taglist show new functions on the fly.

I have something like this:

#include <stdio.h>

int main()
{
   some code here;
}

Taglist would show the main function.

But than I edit the file, and the code in the buffer goes like:

#include <stdio.h>

int function(int x, int y);

int function(int x,int y)
{
    some code here;
}

int main()
{
    some code here;
}

Taglist would only show new function after saving and reopeneing file, :TlistUpdate would not help.

So the question is how do I make taglist show newly written functions, if possible - automatically and if possible - even when buffer is not saved yet?

I believe it's rather software issue than development question, hence superuser.com

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Solved; I added the following to my .vimrc:

autocmd BufWritePost *.c :TlistUpdate

According to taglist's FAQ, ctags can only work with file existing on disc, so updating taglist on unsaved buffer would not do anything.

Automatic update is possible, and showing new functions in unsaved buffer is not.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.