<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nullcortex &#187; howto</title>
	<atom:link href="http://nullcortex.com/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://nullcortex.com</link>
	<description>some words, some code, and some pictures</description>
	<lastBuildDate>Fri, 29 Jan 2010 18:43:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Nano Nano</title>
		<link>http://nullcortex.com/2008/07/nano-nano/</link>
		<comments>http://nullcortex.com/2008/07/nano-nano/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 17:35:00 +0000</pubDate>
		<dc:creator>bnrubin</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nano]]></category>

		<guid isPermaLink="false">http://nullcortex.com/?p=7</guid>
		<description><![CDATA[I use nano as my primary CLI editor.  It may not have as many features as vi(m) or Emacs (in no particular order), it is fast and easy for me. One of the features that many people do not realize that nano supports is syntax highlighting.  This can quickly and easily be enabled by following [...]]]></description>
			<content:encoded><![CDATA[<p>I use nano as my primary CLI editor.  It may not have as many features as vi(m) or Emacs (in no particular order), it is fast and easy for me.</p>
<p>One of the features that many people do not realize that nano supports is syntax highlighting.  This can quickly and easily be enabled by following these directions:</p>
<p>nano will automatically read in ~/.nanorc if it exists.  Since you probably don&#8217;t have that file there already, go ahead and copy the sample file out of /etc:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #7a0874; font-weight: bold;">&#91;</span>pici<span style="color: #000000; font-weight: bold;">@</span>romulus:~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nanorc ~<span style="color: #000000; font-weight: bold;">/</span>.nanorc</pre></div></div>

<p>Highlighting for each language needs to be turned on explicitly in your new .nanorc file.  In Intrepid, the lines specifying each language begin around line 217, which is probably around the same area in other releases.  If not, this is what you&#8217;re looking for something similar to this:</p>
<h5>some default languages supported by nanorc:</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Nanorc files</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/nanorc.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## C/C++</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/c.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## HTML</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/html.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## TeX</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/tex.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Quoted emails (under e.g. mutt)</span>
<span style="color: #666666; font-style: italic;"># include &quot;/usr/share/nano/mutt.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Patch files</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/patch.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Manpages</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/man.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Groff</span>
<span style="color: #666666; font-style: italic;"># include &quot;/usr/share/nano/groff.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Perl</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/perl.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Python</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/python.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Ruby</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/ruby.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Java</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/java.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Assembler</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/asm.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Bourne shell scripts</span>
include <span style="color: #ff0000;">&quot;/usr/share/nano/sh.nanorc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## POV-Ray</span>
<span style="color: #666666; font-style: italic;">#include &quot;/usr/share/nano/pov.nanorc&quot;</span></pre></div></div>

<p>Go ahead and remove the hash from each include statement for the languages you wish to enable, and you&#8217;re all done.</p>
<p>Some other options that I find helpful to have in my .nanorc are as follows:</p>
<h5>Other options:</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Setup tabs</span>
<span style="color: #000000; font-weight: bold;">set</span> autoindent
<span style="color: #000000; font-weight: bold;">set</span> tabstospaces
<span style="color: #000000; font-weight: bold;">set</span> tabsize <span style="color: #ff0000;">&quot;4&quot;</span>
<span style="color: #666666; font-style: italic;">## Don't wrap text at all.</span>
<span style="color: #000000; font-weight: bold;">set</span> nowrap</pre></div></div>

<p><i>Screenshot coming soon.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://nullcortex.com/2008/07/nano-nano/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
