<?xml version="1.0"?><rss version="2.0">
<channel>
  <title>Alan&#039;s Ramblings - colour scheme tag</title>
  <link>http://bleaklow.com:80/tags/colour scheme/</link>
  <description>My opinions may be incorrect, but they are my own</description>
  <language>en</language>
  <copyright>Alan Burlison</copyright>
  <lastBuildDate>Wed, 29 Feb 2012 20:50:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  <image>
    <url>http://bleaklow.com/images/misc/logo.gif</url>
    <title>Alan&#039;s Ramblings</title>
    <link>http://bleaklow.com:80/</link>
  </image>
  <item>
    <title>Hints on creating 256-colour themes for vim</title>
    <link>vim 256 colour</link>
    <description>
          &lt;p&gt;
Most existing &lt;a href=&#034;http://www.vim.org/&#034;&gt;vim&lt;/a&gt; colour themes are designed for the graphical version of vim, gvim.  They don&#039;t work properly at all if you are running vim in a terminal, and there are very few themes available for vim in terminal-mode. You are pretty much obliged to make your own if one of the small number of available ones doesn&#039;t suit.  Here&#039;s a list of hints and tips that I discovered in the process of creating one:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If your shell&#039;s setting for &lt;code&gt;$TERM&lt;/code&gt; is &lt;code&gt;xterm&lt;/code&gt; you won&#039;t get colour support.  It needs to be &lt;code&gt;xtermc&lt;/code&gt; or you need to add a &lt;code&gt;set term=xtermc&lt;/code&gt; in your &lt;code&gt;.vimrc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Even with the terminal type set you may not get 256 colours if you are using gnome-terminal.  To fix that, put &lt;code&gt;set t_Co=256&lt;/code&gt; in your &lt;code&gt;.vimrc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In vim, type &lt;code&gt;:help highlight&lt;/code&gt; to get instructions on how to specify colours in vim.&lt;/li&gt;
&lt;li&gt;To make the process of authoring a colour theme easier, install the &lt;a href=&#034;http://www.vim.org/scripts/script.php?script_id=85&#034;&gt;Mkcolorscheme.vim&lt;/a&gt; script in your vim plugin directory, uncommenting the four commands at the top of the file.  Read the instructions in the plugin, they give you hints on how to identify the colours currently being used by syntax elements.&lt;/li&gt;
&lt;li&gt;Open a new subwindow in vim and type &lt;code&gt;:so $VIMRUNTIME/syntax/hitest.vim&lt;/code&gt;.  That will display a table of the current settings, which will be updated as you interactively change colours.&lt;/li&gt;
&lt;li&gt;Open this &lt;a href=&#034;http://upload.wikimedia.org/wikipedia/commons/9/95/Xterm_color_chart.png&#034;&gt;colour chart&lt;/a&gt; in your browser, it gives you the colour numbers you&#039;ll need to set the colours.&lt;/li&gt;
&lt;li&gt;Open up a source file of the type that you want to set the syntax colouring for, put the cursor over an element and use the &lt;code&gt;:GetSyntax&lt;/code&gt; command to identify the element type, followed by the appropriate&lt;code&gt;:highlight&lt;/code&gt; command to set the element colour.&lt;/li&gt;
&lt;li&gt;When you are done, use the &lt;code&gt;:Mkcolorscheme&lt;/code&gt; command to generate a set of commands to generate the colour scheme settings.  Delete any lines containing &lt;code&gt;cleared&lt;/code&gt; as they aren&#039;t valid.&lt;/li&gt;
&lt;li&gt;Save the colour scheme to a file in your vim &lt;code&gt;colors&lt;/code&gt; directory and load the scheme with a &lt;code&gt;colorscheme&lt;/code&gt; command in your &lt;code&gt;.vimrc&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;</description>
      <category>Tech</category>
    <comments>http://bleaklow.com:80/2011/09/21/hints_on_creating_256_colour_themes_for_vim.html#comments</comments>
    <guid isPermaLink="true">vim 256 colour</guid>
    <pubDate>Wed, 21 Sep 2011 20:06:00 GMT</pubDate>
  </item>
  </channel>
</rss>

