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

后端 未结 4 1293
情书的邮戳
情书的邮戳 2020-12-23 14:28

In Vim, I want to use a different colorscheme for each file type.

e.g. I want to use desert256 colorscheme for Py

4条回答
  •  醉酒成梦
    2020-12-23 14:47

    I have a hack you may like. It is far from perfect, and it doesn't use a .vimrc, but it works for me. It requires you to type a different command to edit different files. It works using the -c parameter when you call gvim. This argument allows you to run vim commands after loading the file. Add this to your ~/.bashrc ( I guess you are using bash ) :

    alias gpy="gvim -c 'colorscheme desert'"
    alias gcs="gvim -c 'colorscheme jellybeans'"
    

    Hope this helps

提交回复
热议问题