• K
  • Obtaining and using the Vim plain text editor.

    Installing Vim

    Vim is probably already on your machine (Linux and Mac OS X). Proceed to using Vim, if it doesn't seem to be there see about getting Vim.

    Using Vim

    See also:

    Check for trailing whitespace

    In normal (command) mode, type : and then:

    Enable Syntax Checking

    With two lines in your .vimrc file (vi ~/.vimrc to edit or create it) you can enable

    set makeprg=php\ -l\ %
    set errorformat=%m\ in\ %f\ on\ line\ %l

    In normal (command) mode, type :make% and press enter to run the PHP syntax check. If there are any errors, it will list them for you and take you to the first one when you press enter again.


  • Author(s)

  • Benjamin Melançon