Context Navigation

Here is a small script that will detect some guideline violations for vim. I put it in my .vimrc and it highlight all the errors it can find in all opened files.
I'd like to know if you made improvements on it.

Calling the function

It is also possible to make it run on every opened file (this is a bit annoying when using vim for something else than Haiku or C++ files)

" autocmd that will set up the w:created variable (vim tip 1598)
" so we can run the check only once per window
autocmd VimEnter * autocmd WinEnter * let w:created=1
" call the function on all opened files
autocmd WinEnter * if !exists('w:created') | call FuncHaikuCheck() | endif
autocmd BufWinEnter * call FuncHaikuCheck()

The last option is to define a keyboard shortcut to enable it (control+F3 in this example) :