Is there a way to get a basic PHP error stressing VIM?

I really like VIM, but one thing I can’t get around is the simple error underlying it, like in netbeans and Visual Studio. I often make stupid mistakes like

if checkit($url) { } 

instead

 if (checkit($url)) { } 

A little reddish underline is a lifesaver when it comes to this kind of thing. Is there a plugin for vim that will save me from php stupid hell errors? Thanks.

+4
source share
3 answers

Use Syntastic

To make it work efficiently, you can add this little tweak to your .vimrc :

 function! s:SaveAll() w | :Error endfunction command! -bar -narg=0 W call s:SaveAll() 

now, using :W to save your file, a list of locations with any errors will also be displayed.

+5
source

Check out the CheckSyntax plugin for vim , which supports the equivalent of 'php -l' and 'php - f'.

Vim does not have squiggly underscore support, which we are all used to, but you can get the "red marker in the column" effect used in Eclipse with this blog post .

+2
source
+1
source

Source: https://habr.com/ru/post/1298964/


All Articles