How to set a different colorscheme for each file type in Vim?

I’ve been looking for the same thing. This inside your .vimrc works reasonably well although not perfect.

autocmd BufEnter * colorscheme default
autocmd BufEnter *.php colorscheme Tomorrow-Night
autocmd BufEnter *.py colorscheme Tomorrow

(Note if you’re looking for a good dark color theme Tomorrow-Night looks pretty good. Very similar to theme used on Code Academy.)

Leave a Comment