| 1 | 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. |
| 2 | I'd like to know if you made improvements on it. |
| 3 | |
| 4 | {{{ |
| 5 | autocmd QuickFixCmdPost make cw |
| 6 | |
| 7 | " autocmd that will set up the w:created variable (vim tip 1598) |
| 8 | autocmd VimEnter * autocmd WinEnter * let w:created=1 |
| 9 | |
| 10 | :fu FuncHaikuCheck() |
| 11 | call matchadd('ErrorMsg', '\%>80v.\+', -1) " More than 80 chars on a line |
| 12 | call matchadd('ErrorMsg', ' ', -1) " Two spaces (likely wrong indentation) |
| 13 | call matchadd('ErrorMsg', 'for(', -1) "for without space |
| 14 | call matchadd('ErrorMsg', 'if(', -1) " if without space |
| 15 | call matchadd('ErrorMsg', 'while(', -1) " while without space |
| 16 | :endfu |
| 17 | |
| 18 | " call the function on all opened files |
| 19 | autocmd WinEnter * if !exists('w:created') | call FuncHaikuCheck() | endif |
| 20 | autocmd BufWinEnter * call FuncHaikuCheck() |
| 21 | }}} |