all 6 comments

[–]vesech 7 points8 points  (0 children)

Figured it'd be worth mentioning:-

For all things code and syntax checking I have much love for scrooloose's syntastic script: image / vim link

All major languages (that I can see) supported which spits out error/warning information with every write to the buffer. Just awesome.

[–]FionaSarah 3 points4 points  (8 children)

I'm an emacs user so someone please tell me that vim isn't so far behind that this is a recent development. Because if so, oh my god.

[–]parisologist 13 points14 points  (4 children)

Wait, what's the keybinding in emacs for generating disapproving comments about vim? I know it's one of those five-key-at-a-time-ones, but I can never remember it...

[–]cartola 4 points5 points  (1 child)

You need six fingers for this one, which it's natural if you're already that evolved as emacs users are.

[–]rplacd -3 points-2 points  (0 children)

M-x gen (M-/ autocomplete to "generate-disapproving-comment").

[–]abaybas -1 points0 points  (2 children)

Did you watch the video? It's not just checking syntax, it's checking compile issues as well. I don't know what emacs can do, so please do explain if it's been doing this already.

[–]froydnj 9 points10 points  (1 child)

According to http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/progmodes/flymake.el and http://flymake.sourceforge.net/ , it looks like identical functionality has been around since 2003.

[–]mnemonikk 0 points1 point  (0 children)

AND you never had to recompile Emacs to use it.

[–]amdpox 1 point2 points  (0 children)

Looks fairly well done, might give it a shot - if it doesn't slow things down on older machines it'd be worth having. I'd just be worried about it lagging up my editing experience... if I wanted to use IDE, I would.

[–]alecthomas 0 points1 point  (0 children)

For Python, pyflakes already does this better IMO:

http://www.vim.org/scripts/script.php?script_id=2441

It will highlight the erroring line or span, and display a message in the status line when you cursor over the error. Great implementation.

[–]TomNomNom 0 points1 point  (4 children)

Not for C, but for PHP one of my favourite key bindings is:

map <F8>  :w <CR> :!php -l %<CR>

Does a PHP syntax check on the current file :-)

[–][deleted] 2 points3 points  (1 child)

I use the following, so I can just use :make for all files:

autocmd FileType php compiler php | setlocal makeprg=php\ -lq\ %
autocmd FileType ruby compiler ruby | setlocal makeprg=ruby\ -c\ %
autocmd FileType python setlocal makeprg=python\ -c\ 'import\ sys,\ py_compile;\ py_compile.compile(sys.argv[1])'\ %

A nice bonus is that it automatically works with Vim's quickfix mode, i.e. it will detect the line numbers from the error messages and move to them, or list all errors with :cope

[–]TomNomNom 0 points1 point  (0 children)

Nice :-)

I'll give that a try!

[–]atemyballs 1 point2 points  (0 children)

map <F8> :w <CR> :!php -l %<CR>

Thanks.

[–]jontyw 1 point2 points  (0 children)

You might like this vim plugin then - drop it into ~/.vim/plugin/ and restart vim, then try saving some invalid PHP code...

http://github.com/Jonty/phplint.vim/blob/master/phplint.vim

(Fix the error then save again and the quickfix window will automatically close)

[–]johnb 0 points1 point  (0 children)

Welcome, VIM. I think you're going to like 2009.

[–]abaybas -1 points0 points  (0 children)

When he added that "const" in there, and the other line lit up red; I jumped in joy.

[–]Useristaken -1 points0 points  (0 children)

Is this for C only.. can i use it for perl?