<?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>Updates: rarely to never &#187; Religion</title>
	<atom:link href="http://grimboy.co.uk/blawg/category/religion/feed/" rel="self" type="application/rss+xml" />
	<link>http://grimboy.co.uk/blawg</link>
	<description>Since 2006!</description>
	<lastBuildDate>Sun, 27 Jun 2010 05:50:05 +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>Vim is teh awesombe!</title>
		<link>http://grimboy.co.uk/blawg/vim-is-teh-awesombe/</link>
		<comments>http://grimboy.co.uk/blawg/vim-is-teh-awesombe/#comments</comments>
		<pubDate>Fri, 01 Dec 2006 00:34:21 +0000</pubDate>
		<dc:creator>grimboy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Religion]]></category>
		<category><![CDATA[Text manipulation]]></category>

		<guid isPermaLink="false">http://grimboy.co.uk/blawg/vim-is-teh-awesombe/</guid>
		<description><![CDATA[photo by lilit I recently started using vim as my primary text editor. I&#8217;m no expert with it (yet) I&#8217;m just posting with some advice to other people who also want to do the same. But first, I&#8217;m going to tell you why vim is good. Fast in terms of loading Fast in terms of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://static.flickr.com/13/14530246_21061b69c6.jpg" alt="Vim" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/lilit/14530246/">lilit</a></cite></p>
<p>I recently started using vim as my primary text editor. I&#8217;m no expert with it (yet) I&#8217;m just posting with some advice to other people who also want to do the same. But first, I&#8217;m going to tell you why vim is good.</p>
<ul>
<li>Fast in terms of loading</li>
<li>Fast in terms of usage</li>
<li>Customisability</li>
<li>Expandability</li>
<li>Portability</li>
<li>Makes you feel all tingly when you do something in just a few keystrokes</li>
</ul>
<p>Lots of people reject the idea of heavily keyboard and (human) memory reliant editors such as Emacs or vim because they have a steep learning curve. However, I&#8217;ve found vim&#8217;s learning curve to be pretty reasonable, and if you code professionally or even as a regular hobby then it&#8217;s worth taking the time to learn an editor that will speed you up.</p>
<p><img src="http://static.flickr.com/16/20308963_0a89eb264e_o.jpg" alt="Coffee &#038; Cream" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/geeksnap/">hulksjedi</a></cite></p>
<p>There&#8217;s a nice little vim configuration thing called <a href="http://cream.sourceforge.net/">Cream</a>. From what I understand this comes in two components:</p>
<ol>
<li>A number of configurations and macros for normal vim</li>
<li>Cream itself (still vim underneath, but even milder, vim on tranquillisers)</li>
</ol>
<p>I find this quite useful in that it makes normal vim behave a little bit more with its macros. However, Cream itself is too mild, it&#8217;s like using a normal text editor.</p>
<p>So, in conclusion, Cream is good. Download it and install it, but use vim configured by cream. Don&#8217;t use just cream itself. Well, actually you can &#8211; in fact it&#8217;s a nice gentle introduction to vim. If you just want a <em>normal</em> text editor then I recommend you use cream itself. I used cream itself for a while in &#8220;expert mode&#8221; before trying to customise it and failing. One thing that annoyed me in particular while coding python was that &#8220;expand tabs&#8221; worked for a single document, then claimed it was on but had to be turned off and on before it would start working again. I also wanted to be able to have the exact same configuration <strong>everywhere</strong>. This includes stuff like SSHing into Dreamhost and doing a hot-fix on a website or messing around on my old computer underneath the desk<sup>TM</sup> that does odd jobs like backups, svn, trac and an IRC bot. I had trouble doing configuration for Cream itself and I didn&#8217;t feel in control. So really, Cream configured or not (g)vim itself was the only option for me. </p>
<p><img src="http://static.flickr.com/4/7668881_4ec378cf4f.jpg" alt="School children in Sanorgaon" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/phitar/">phitar</a></cite></p>
<p>Anyway, let&#8217;s rewind a bit. If you want to learn vim use the tutor. Invoke the tutor by opening a terminal or a dos prompt or whatever and entering <code>vimtutor</code> in it (this assumes vim is in your path). Do the entire tutor, then do it again. This is the only way. You probably won&#8217;t find it difficult but you may very well find yourself thinking &#8220;this is pointless, weird and archaic&#8221; every now and then. I know I did. However, your brain <strong>will</strong> know when to use various keystrokes magically<sup>1</sup>. Apart from the tutor I found <a href="http://www.vi-improved.org/tutorial.php">this charming IRC style tutorial</a> quite useful for a bit of light revision later on. On top of that there&#8217;s always <a href="http://www.vim.org/tips/">the official vim tips repository</a> which is useful for specific pieces of insight. <a href="http://www.vim.org/tips/tip.php?tip_id=305">This tip</a> is particularly useful in a general sense as it is a compilation.</p>
<p><img src="http://static.flickr.com/75/221509655_f76e7dbcd2.jpg" alt="A Contraption" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/tojosan/221509655/">tojosan</a></cite></p>
<p>Ok, so now that you know this little editor that is fast in all senses of the word you&#8217;re probably wondering about one of its most loved features, its customisability. Firstly there is the .vimrc (or _vimrc on windows). This is something that I did mostly by example, there are a number of heavily commented .vimrc files out there so it&#8217;s fairly easy to just read through them until an option catches your eye. Here are <a href="http://www.stripey.com/vim/vimrc.html">two</a> of my <a href="http://www.ashberg.de/vim/vimrc.html">favourites</a>. Obviously if you want to customise something in particular then you can search through help or fall back to teh interwabs.</p>
<p>Here&#8217;s mine:<br />
<code>" Kill all the tabs.<br />
set ts=4<br />
set sw=4<br />
set et<br />
set nu<br />
set sr</p>
<p>" use <ctrl>+N/</ctrl><ctrl>+P to cycle through tabs (the gui kind):<br />
nnoremap <c -N> :tabnext<cr><br />
nnoremap <c -P> :tabprev<cr></p>
<p>" autoindenting<br />
set ai<br />
" smartindenting<br />
set si<br />
" a <tab> in an indent insets 'shiftwidth' spaces (not tabstop)<br />
set smarttab<br />
" if non-zero, number of spaces to insert for a </tab><tab><br />
set softtabstop=4<br />
" no real wrap during insert<br />
set tw=0</p>
<p>" have the h and l cursor keys wrap between lines (like <space> and <bkspc> do<br />
" by default), and ~ covert case over line breaks<br />
set whichwrap=h,l,~,[,]</p>
<p>" allow </bkspc><bkspc> to delete line breaks, beyond the start of the current<br />
" insertion, and over indentations:<br />
set backspace=eol,start,indent</p>
<p>" have <tab> (and <shift>+<tab> where it works) change the level of<br />
" indentation:<br />
inoremap </tab><tab> <c -T><br />
inoremap <s -Tab> <c -D><br />
" [<ctrl>+V <tab> still inserts an actual tab character.]</p>
<p>" map 'F12' to change the pwd of vim to the cwd of the current file<br />
noremap <f12> :cd %:p:h<cr></p>
<p>" pyLint the python 'compiler'<br />
autocmd FileType python compiler pylint</p>
<p>" Purdy color scheme<br />
colorscheme inkpot<br />
</cr></f12></tab></ctrl></c></s></c></tab></shift></tab></bkspc></space></tab></cr></c></cr></c></ctrl></code></p>
<p><img src="http://static.flickr.com/49/233979977_1cfea9cfcc.jpg" alt="Disassembled Plug" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/jm3/233979977/">jm3</a></cite></p>
<p>Plugins are the next thing. This is pretty obvious, just get some from <a href="http://www.vim.org/scripts/">the official vim plugin repository</a> and shove them in ~/.vim/plugin/ (or C:\Program Files\Vim\vimfiles\plugin\ on windows) and shove <a href="http://www.vim.org/scripts/script.php?script_id=625">colour schemes</a> in ~/.vim/colors/. My favourite plugins at the moment are (keep in mind that some of these are geared toward python/html stuff):</p>
<ul>
<li><a href="http://www.vim.org/scripts/script.php?script_id=625">Colours Sample Pack</a> &#8211; brings variety to the editing experience. Although I am quite settled on inkpot although matrix is good if someone else is in the room.</li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1633">Subversion (svn) Integration Plugin, update with stupid star trek name</a> &#8211; Means I don&#8217;t have to switch into a terminal as often. (Well I&#8217;d probably use :!svn &#8230; if I didn&#8217;t use this)</li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=790">python.vim</a> &#8211; Some python related menu commands. You need to shove the following in your ~/.vimrc <code>au FileType python source ~/.vim/plugin/python.vim</code></li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=127">runscript.vim</a> &#8211; Again, saves me doing a terminal or !python moo.py &#8230;</li>
<li><a href="http://vim-taglist.sourceforge.net/">Vim Taglist</a> &#8211; Turns vim into a source code browser. Endlessly useful for large files.</li>
</ul>
<p><img src="http://static.flickr.com/12/182747253_525dc4e693.jpg" alt="The Halls of Stanford" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/akash_k/182747253/">akash_k</a></cite></p>
<p>Finally, I said at the beginning that one of my requirements was to have the same configuration across several machines. What I&#8217;ve done is made a vim repository in svn (I use version control for everything) which I check out on all the machines I want to have configured then <code>svn co</code> and <code>ln -s</code> bits of it it to various directories (on windows I just check out bits of the tree directly). I have the plugin and color directories in the repository. I also have a directory called common. When I said I was showing you my .vimrc I was actually showing a file called /common/vimrc in the vim repository. I then source it from all of my .vimrc files. On Ubuntu on my laptop my .vimrc looks like<sup>2</sup>:</p>
<p><code>source $VIMRUNTIME/vimrc_example.vim<br />
source $VIMRUNTIME/mswin.vim<br />
behave mswin</p>
<p>source $HOME/.vim/common/common.vim<br />
set guifont=ProFontWindows\ 9</code><br />
(Yes, I use windows shortcuts on linux)</p>
<p><img src="http://static.flickr.com/102/298233445_216e295736.jpg" alt="Sunset de la Pollution" /><br />
<cite>photo by <a href="http://www.flickr.com/photos/tengis/">tengis</a></cite></p>
<p>In conclusion, I&#8217;m very happy with vim. It has replace notepad++ on Windows and a different editor every month on Linux. I like controlling everything with the keyboard, a keyboard is ordered. A mouse is chaotic and can easily just wander off into Firefox onto a Wikipedia article about conspiracy theories, or something similarly stupid. Also I&#8217;ve never quite been satisfied with using dialogs to do stuff (e.g. open files, change font), gvim provides this option, but I can just as easily do this by typing if I already know what I want<sup>3</sup>. Also being able to execute terminal/dos commands directly from an editor is unspeakably convenient. If you&#8217;re learning vim and want advice or have a question, or if you are a vimmer already and want to correct me on anything I&#8217;ve said, then scratch the itch and leave a comment.</p>
<ol>
<li>No, seriously.</li>
<li>I&#8217;m not lying this time.</li>
<li>I think using dialogs are like window shopping. Prompts are like entering a number into the computer thing in Argos<sup>4</sup>.</li>
<li>Nation specfic references and corporate endorsement all in one. I must be turning into an evil.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://grimboy.co.uk/blawg/vim-is-teh-awesombe/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
