Frage

I connect to my server through SSH in Terminal.app to use Vim to edit PHP scripts.

I have install some plugins, including php.vim and another php.vim but it doesn't show me anything! So how can I enable highlighting?

War es hilfreich?

Lösung

You don't need these plugins.

Just type :syntax on in normal mode or add syntax on to ~/.vimrc on the server.

Assuming, of course, that you run a reasonably recent version of Vim on a UNIX-y server.

Andere Tipps

There's no need for those plug-ins, simply put the following in your .vimrc:

syntax on

To debug further, you need to ensure you have the following set once you open a PHP file:

syntax=php
filetype=php

You can check these like so:

:verbose set syntax? filetype?

You should see something like this:

  syntax=php
        Last set from /usr/local/share/vim/vim73/syntax/syntax.vim
  filetype=php
        Last set from /usr/local/share/vim/vim73/filetype.vim

If syntax highlighting isn't working for other file-types, check the values of:

:echo $TERM 
:echo $TERMCAP
:echo &t_Co

To ensure you're using a terminal type that allows colour.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top