I am implementing Plain Text/Source Code File Header for Vim and I need my parser to run after the file, since it needs the first 60 lines of the buffer. I successfully made a manual parser, but it needs me to run call PtScParse() on each buffer by hand. Is there a way to make PtScParse() automatically run on each buffer?
My parser is on this DARCS repo. Look for the ptsc-header.vim file.
Reading the documentation in
:help initializationand:help :autocmdI found my solution. AllI had to do was to add the following line at the end of the script:
It calls
PtScHeaderParse()on all files on eventVimEnter.Now every time I open a file, the function runs and shows my code properly 🙂