<?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>The Fugue &#187; vim</title>
	<atom:link href="http://hans.fugal.net/blog/tag/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://hans.fugal.net/blog</link>
	<description>Counterpoint by Hans Fugal</description>
	<lastBuildDate>Fri, 11 Jun 2010 17:38:13 +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>MacVim :recover</title>
		<link>http://hans.fugal.net/blog/2009/07/12/macvim-recover/</link>
		<comments>http://hans.fugal.net/blog/2009/07/12/macvim-recover/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 13:42:46 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macvim]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://hans.fugal.net/blog/?p=1158</guid>
		<description><![CDATA[When your battery dies while editing a new unsaved file in MacVim, and instead of going to sleep as it should your laptop rudely shuts down, when you boot up and start MacVim again you may begin to panic because it doesn't do the regular Vim recovery dance. Fear not, all is not lost. It's [...]]]></description>
			<content:encoded><![CDATA[<p>When your battery dies while editing a new unsaved file in <a href="http://code.google.com/p/macvim/">MacVim</a>, and instead of going to sleep as it should your laptop rudely shuts down, when you boot up and start MacVim again you may begin to panic because it doesn't do the regular <a href="http://www.vim.org">Vim</a> recovery dance.</p>
<p>Fear not, all is not lost. It's there ready for recovery. Just type <code>:recover</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2009/07/12/macvim-recover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why vimdiff?</title>
		<link>http://hans.fugal.net/blog/2009/02/13/why-vimdiff/</link>
		<comments>http://hans.fugal.net/blog/2009/02/13/why-vimdiff/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 00:32:04 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[filemerge]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[mergetool]]></category>
		<category><![CDATA[opendiff]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vimdiff]]></category>

		<guid isPermaLink="false">http://hans.fugal.net/blog/?p=1103</guid>
		<description><![CDATA[I love Vim and vimdiff, but vimdiff is pitiful for doing 3-way merges. So I wonder why git's search for a merge tool prefers vimdiff over opendiff (which launches OS X's fantastic FileMerge program). git config --global merge.tool opendiff]]></description>
			<content:encoded><![CDATA[<p>I love Vim and vimdiff, but vimdiff is pitiful for doing 3-way merges. So I wonder why git's search for a merge tool prefers vimdiff over opendiff (which launches OS X's fantastic FileMerge program).</p>
<p><code>git config --global merge.tool opendiff</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2009/02/13/why-vimdiff/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>sh.vim</title>
		<link>http://hans.fugal.net/blog/2008/03/29/sh-vim/</link>
		<comments>http://hans.fugal.net/blog/2008/03/29/sh-vim/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 00:38:58 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bourne]]></category>
		<category><![CDATA[highlighting]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[posix]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Have you ever been frustrated with perfectly valid bash syntax being highlighted as incorrect in vim? Like this: #!/bin/sh foo=$(ls /tmp) $() is a perfectly valid, nay preferred substitute for backticks. The problem is that vim is deciding this is pure old bourne shell instead of whatever else we'd like it to be. If you [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been frustrated with perfectly valid bash syntax being highlighted as incorrect in vim? Like this:</p>
<pre><code>
#!/bin/sh
foo=<span style="color:red">$(</span>ls /tmp<span style="color: red">)</span>
</code></pre>
<p><code>$()</code> is a perfectly valid, nay preferred substitute for backticks. The problem is that vim is deciding this is pure old bourne shell instead of whatever else we'd like it to be. If you change the shebang to <code>#!/bin/bash</code> and re-edit the file, then the error markings go away. But maybe you're writing for the nebulous POSIX shell, not bash nor sh. Or maybe you just don't care and you don't want vim complaining that you're using bashisms even though your shebang says sh. You can set the defaults so that it reflects your system and preferences. It's all there in <code>:help sh.vim</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2008/03/29/sh-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gvim on OS X</title>
		<link>http://hans.fugal.net/blog/2007/02/18/gvim-on-os-x/</link>
		<comments>http://hans.fugal.net/blog/2007/02/18/gvim-on-os-x/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 18:18:00 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In spite of being the author of one of the more (in)famous vim color schemes, desert.vim, I have been vimming primarily in the console for quite some time now. The primary reason is that gvim on OS X sucks. Still, it's nice to have gvim working for various reasons. One of the more important reasons [...]]]></description>
			<content:encoded><![CDATA[<p>In spite of being the author of one of the more (in)famous vim color schemes,<br />
<a href="http://www.vim.org/scripts/script.php?script_id=105">desert.vim</a>, I have been<br />
vimming primarily in the console for quite some time now. The primary reason is<br />
that gvim on OS X sucks. </p>
<p>Still, it's nice to have gvim working for various reasons. One of the more<br />
important reasons is dragging stuff to the Vim icon on the dock. </p>
<p>As a follow-up to my post on unicode in the terminal, I decided to install the latest Vim.app from <a href="http://www.macvim.org/OSX">macvim.org</a> and see how it handled unicode. It didn't handle it very well, but it's only a few settings away.</p>
<p>First, there's the issue of font. I don't like Monaco very much. I use<br />
<a href="http://www.ms-studio.com/FontSales/anonymous.html">Anonymous</a> for the terminal<br />
and I think it is an excellent font. In fact, I find myself likeing Anonymous<br />
just as much as <a href="http://www.is-vn.bg/hamster/jimmy-en.html">Terminus</a>, but it<br />
has the added advantage of being TrueType and looking great with antialiasing.<br />
Unfortunately, in Vim at least it looks terrible <em>without</em> antialiasing. So I<br />
got the <a href="http://fractal.csie.org/~eric/wiki/Terminus_font">pseudo-TrueType Terminus<br />
font</a> by Eric Cheng. It took<br />
some fiddling, because of various Bad Things™ happening with Vim and OS X<br />
dealing with a TrueType-wrapped bitmap font, but I found the following settings<br />
work great (put them in <code>~/.gvimrc</code>):</p>
<pre><code>set enc=utf-8
set macatsui noanti gfn=Terminus:h12
</code></pre>
<p>It's not antialiased, but it is Terminus and it handles Unicode just fine (as<br />
far as the Terminus font itself does, which is pretty good).</p>
<p>You can use antialiased fonts, e.g. Anonymous, with the following <code>.gvimrc</code>:</p>
<pre><code>set enc=utf-8
set nomacatsui anti termencoding=macroman gfn=Anonymous:h10
</code></pre>
<p>but Bad Things™ happen when you use Unicode, so I'm sticking with the Terminus setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2007/02/18/gvim-on-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Terminal Unicode Wrangling on OS X</title>
		<link>http://hans.fugal.net/blog/2007/02/18/terminal-unicode-wrangling-on-os-x/</link>
		<comments>http://hans.fugal.net/blog/2007/02/18/terminal-unicode-wrangling-on-os-x/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 16:19:00 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[coreutils]]></category>
		<category><![CDATA[iTerm]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is the 21st Century. It's time for Unicode. OS X does a decent job of supporting Unicode overall, but it is far from perfect. Perhaps the most noticeable is the mass confusion that is Unicode in the terminal. The problem is actually legion, and it takes a little effort to fix it. But you [...]]]></description>
			<content:encoded><![CDATA[<p>This is the 21<super>st</super> Century. It's time for Unicode. OS X does a      decent job of supporting Unicode overall, but it is far from perfect. Perhaps   the most noticeable is the mass confusion that is Unicode in the terminal. The  problem is actually legion, and it takes a little effort to fix it. But you     can fix it and you can do it today.</p>
<p>Start at <a href="http://www.rift.dk/news.php?item.7.6">this article on Internationalizing the Mac OS X terminal</a>. Following the instructions there will get you 90%   of the way there. You will install a new version of bash and coreutils (for     ls, cd, etc.), you'll set up your locale information (actually you only need    to set LANG, in my experience. I <code>export LANG=en_US.UTF-8</code> in my <code>.bashrc</code>).</p>
<p>If you use OS X's default vim (<code>/usr/bin/vim</code>), it will Just Work. But if you    have vim 7.0 from some other source, it may or may not work. In particular if   you do <code>sudo port install vim</code> you'll probably get a broken vim. Be sure to     use the multibyte variant if you install from ports.</p>
<p>If you use iTerm, it might work worse than before you made the changes above.    But notice that it works fine if you run another bash instance, or screen. I'm  not sure but I think you fix it with the <code>LC_CTYPE</code> hack detailed in <a href="http://desp.night.pl/terminal.html">this      article</a>. Those <code>.inputrc</code> lines probably   won't hurt either, though I'm not sure what problem they fix. One of those two  changes seems to have fixed the iTerm problem.</p>
<p>Speaking of screen, you probably want to add <code>defutf8 on</code> to your <code>~/.screenrc</code>.</p>
<p>I'm curious if things work out of the box in $YOUR<em>FAVORITE</em>DISTRO. I've         previously mucked about with unicode so much in Debian and Ubuntu I have no     recollection of what the default state of affairs is. Try the following and     let me know in the comments how it worked.</p>
<pre><code>echo æøÜÉ &gt; /tmp/ƒøø
ls /tmp/ƒøø
cat /tmp/ƒ&lt;tab&gt;
vim /tmp/ƒøø
screen vim /tmp/ƒøø
</code></pre>
<p>For me, I see exactly that and exactly what you'd expect on the terminal and in  vim (both in and out of screen), which has never all happened in OS X for me    before. It does work over ssh on my Debian box, but as I say I've played with   things there so it may or may not have worked out of the box.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2007/02/18/terminal-unicode-wrangling-on-os-x/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>:set exrc</title>
		<link>http://hans.fugal.net/blog/2006/08/12/set-exrc/</link>
		<comments>http://hans.fugal.net/blog/2006/08/12/set-exrc/#comments</comments>
		<pubDate>Sat, 12 Aug 2006 18:21:00 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cs]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vimrc]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Let's say you work on more than one project, each of which has different policy about tabs (e.g. one of the only two sane tab policies: all real tabs or all spaces). You need vim to behave one way in project A and another way in project B. You could use modelines, but that's a [...]]]></description>
			<content:encoded><![CDATA[<p>Let's say you work on more than one project, each of which has different policy<br />
about tabs (e.g. one of the only two sane tab policies: all real tabs or all<br />
spaces). You need vim to behave one way in project A and another way in project<br />
B. You could use modelines, but that's a violation of DRY.</p>
<p>The solution is something I'd often wished for but never realized vim did. <a href="http://vimdoc.sourceforge.net/htmldoc/starting.html#.vimrc"><code>set<br />
exrc</code></a> in your <code>~/.vimrc</code> tells vim to search the current directory for a<br />
<code>.vimrc</code> or <code>.exrc</code> file. You might need a few symlinks (automatable with a<br />
Makefile) to reach all the subdirectories of your project tree, but this will<br />
solve all your problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2006/08/12/set-exrc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>flog</title>
		<link>http://hans.fugal.net/blog/2006/05/18/flog/</link>
		<comments>http://hans.fugal.net/blog/2006/05/18/flog/#comments</comments>
		<pubDate>Thu, 18 May 2006 09:04:00 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[typo]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[A while back I switched my blog from Blosxom to Typo. Typo is really spiffy but I am not a fan of HTML edit boxes, so I looked for good blog posting software. I didn't find any, and certainly none that was free, and I was really comfortable with writing my posts using Markdown in [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I switched my blog from Blosxom to Typo. Typo is really spiffy but<br />
I am not a fan of HTML edit boxes, so I looked for good blog posting software.<br />
I didn't find any, and certainly none that was free, and I was really<br />
comfortable with writing my posts using Markdown in vim, so I decided to write<br />
my own. Thus was born flog, so named because it rhymes with blog and reflects<br />
the true effect that my blog has upon the world. </p>
<p>From the README:</p>
<blockquote>
<p>Run <code>flog</code> and edit the post template in <code>$EDITOR</code>. When done, save and exit<br />
    <code>$EDITOR</code> and your post will be submitted.</p>
</blockquote>
<p>I finally got around to adding the pieces to make it robust enough for general<br />
consumption, and so I am releasing it. You can find it at<br />
<a href="http://hans.fugal.net/src/flog">http://hans.fugal.net/src/flog</a>.</p>
<p>Flog uses the MetaWebLog API, so it should work with a variety of blog software.</p>
]]></content:encoded>
			<wfw:commentRss>http://hans.fugal.net/blog/2006/05/18/flog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
