Thursday, October 21, 2010

Re: How can I use another colorscheme for php?

On Thu, October 21, 2010 1:12 pm, 宝宝彪 wrote:
> I have my vim 7.2 use colorscheme desert for C files, but I want to use
> another colorscheme evening for php files.
>
> How should I write vimrc file.
>
> Thanks in advance.

This is quick and dirty and depends on the order in which they were
defined (i.e. the first FileType auto command would also fire, for php
files, but the second one wins):

let g:phpColor = "murphy"
let g:defaultColor = "desert"
au! FileType * exe ":colorscheme " . g:defaultColor
au! FileType php exe ":colorscheme " . g:phpColor

A better approach would be to only change the colorscheme, if the current
colorscheme differs. And you would possibly define all this in a
autocommand group. This is left as an excercise to the reader.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: