如何编写VIM配色方案?
我一直在寻找 VIM 配色方案,并发现了一些很棒的配色方案(特别是通过使用 http:// /code.google.com/p/vimcolorschemetest/),但我总是想改变我发现的每个方面的几个方面。所以我现在决定,我真正想做的是自己制作,或者能够定制我即时找到的。基本上,我想知道的是:
1)如何编写 vim 配色方案——有什么好的(快速)教程吗?
2) 如何添加特定于语言的自定义?就像 Python 一样,我可能对类和方法使用不同的颜色感兴趣(这可能吗?可以进行什么级别的定制?)。如果您能告诉我有关如何针对特定语言进行自定义的任何信息,那就太棒了! (特别是 python,但其他如 C、Java、Ruby 也很棒)
3)是否有好的、完整(最好是注释良好的)模板可供我开始使用,其中包含以下内容的所有方面配色方案,如背景、文本、特定于语言的内容等?
I have been looking around for VIM color schemes and found some great ones out there (esp. by using http://code.google.com/p/vimcolorschemetest/), but I always want to change a few aspects of each one I find. So I've decided now that what I really want to do is make my own, or be able to customize the ones I find on the fly. Basically, what I want to know is:
1) How do I write a vim color scheme -- are there any good (quick) tutorials?
2) How do I add language-specific customizations? Like say for Python, I might be interested in having different colors for classes and methods (is this even possible? What level of customization is possible?). Anything you can tell me about how to customize for specific languages would be fantastic! (esp. python, but also others like C, Java, Ruby would be great)
3) Are there are good, complete (ideally well-commented) templates that I could start from which contain all aspects of a color scheme, like background, text, language specific stuff, and the like?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Vivify 可让您使用颜色选择器以交互方式创建 vim 颜色方案,并使用多个代码示例预览您的方案。
Vivify lets you interactively create vim colorschemes with color pickers and previews your scheme using several code samples.
我没有观看 “为 Vim 创建颜色方案” 集 < a href="http://vimcasts.org/" rel="nofollow noreferrer">VIMcasts,但其他的确实不错。
I didn't watch the "Creating colorschemes for Vim" episode of VIMcasts, but the others are really good.
colorchemes 实际上是 vim 脚本。您可以使用 hi 命令进行着色,其工作原理如下
hi TextType guifg=#hexforegroundcolor guibg=#hexbgcolor gui=bold/italic/underlined/undercurled
(假设您使用 gvim)。如果您仅输入:hi
,您将获得完整的文本类型列表及其当前突出显示另请参见 http://vimdoc.sourceforge.net/htmldoc/syntax.html#:colorscheme
colorschemes are actually vim scripts. You use the hi command for coloring, which works like
hi TextType guifg=#hexforegroundcolor guibg=#hexbgcolor gui=bold/italic/underlined/undercurled
(assumed you use gvim). If you type:hi
only, you get a complete list of text types with their current highlightingsee also http://vimdoc.sourceforge.net/htmldoc/syntax.html#:colorscheme
也许您会发现这个 colorcheme 模板很有用: http://www.vim.org /scripts/script.php?script_id=106
最初的描述是
“这里的理念是为所有重要组提供一个准备取消注释的突出显示命令列表。然后您可以偏离默认值,直到您拿出一个你喜欢的。”
May be you can find this colorscheme template useful: http://www.vim.org/scripts/script.php?script_id=106
The original description is
"The philosophy here is to provide a ready-to-uncomment list of highlight commands for all the important groups. Then you can deviate from the default until you come up with one you like."
启动vim,说“:help语法”,它有快速启动等。
对于完整的模板,请查看您的安装:
colorschemes位于/usr/share/vim/vimcurrent/colors/中,
语言语法位于/usr/share/vim/vimcurrent中/句法/
Launch vim, say ":help syntax", it has quick start etc.
For the complete templates look at your installation:
colorschemes are in /usr/share/vim/vimcurrent/colors/
languages syntax in /usr/share/vim/vimcurrent/syntax/