Thursday, October 21, 2010

回复: How can I use another colorscheme for php?

Thanks it does work.
Also I found another way.
colorscheme desert
au FileType php source <color.vim(absolute path)>
 
 
------------------ 原始邮件 ------------------
发件人: "Christian Brabandt"<cblists@256bit.org>;
发送时间: 2010年10月21日(星期四) 晚上10:37
收件人: "vim_use"<vim_use@googlegroups.com>;
主题: 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

--
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: