开发者

Converting pygments theme to gvim colorscheme

Are there any tools to convert a pygments开发者_如何学Python style definition into a gvim colorscheme?

I found vim2pygments, which converts vim colorschemes to pygments themes, but I haven't found anything doing the inverse. Specifically, I'm using macvim, though I imagine the colorscheme format would be the same for any gvim-derivative (please, correct me if I'm wrong).


I haven't come across anything that will automate this process, but it should be very easy to do by hand. Grab an existing colour scheme, stick it in your ~/.vim/colors/ directory and put the colours that are defined in the pygments scheme into the appropriate places.

For example, if you use my colour scheme (which uses a non-standard format to make it more editable) and make it uses the pygments autumn scheme, you could take the line that looks like this:

let ColourAssignment['Function'] = {"GUIFG": '#007777', "CTERMFG": 'Cyan'}

and change it to look like this:

let ColourAssignment['Function'] = {"GUIFG": '#00aa00'}

(I've removed the colour terminal assignment as you've said you're using a GUI and it is thus largely irrelevant).

It shouldn't take very long to go through the whole set. My colour scheme is designed for dark backgrounds primarily (it adjusts colours if you switch to a light background), but it wouldn't be very hard to get rid of this aspect: change the "Normal" highlighting to be black on white rather than white on black and remove the s:MakeDarker function and the bit in the if &background == 'light' block.

Alternatively, you could do a similar thing with the normal syntax highlighting format by taking (e.g.) darkblue.vim and changing (e.g.):

hi ErrorMsg     guifg=#ffffff guibg=#287eff                     ctermfg=white ctermbg=lightblue

and changing it to:

hi ErrorMsg     guifg=#aa0000 guibg=#ffffff                     ctermfg=white ctermbg=lightblue
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜