« Return to all random blog posts

PHP Syntax Highlighting in Vi / Vim

Because I keep forgetting:

Setting up syntax highlighting in Vim is pretty easy. For one off situations - type the following while in vim:

:syntax on

If you would like syntax highlighting to be on all the time put the following in your ~/.vimrc file:

syntax on

Some other useful .vimrc settings:

set background=dark
syntax on
set ai

"set ai" does auto-indentation in vim

 

 

Comments:
Show comments