On Nov 13, 2:38 am, Frank Shute <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm tring to select a colorscheme dependent on filetype for gvim.
>
> I've got this in ~/.gvimrc:
>
> filetype plugin on
>
> if &ft == "sh" || &ft == "perl"
> colors desert
> else
> colors wombat
> endif
>
> Unfortunately, this always gives me colorscheme wombat. Could somebody
> tell me what I'm doing wrong?
>
Your .gvimrc will run only one time at Vim startup. At Vim startup,
filetype is probably an empty string. Thus, wombat will always be set.
In order to run code every time you load a file, you need to use an
autocmd. See :help autocmd. The particular event you want is probably
the "FileType" event, which will fire every time you set a file type
or one is set automatically. See :help FileType.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---