<?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>Next Door Hacker &#187; vim</title>
	<atom:link href="http://www.nextdoorhacker.com/tag/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nextdoorhacker.com</link>
	<description>I&#039;m just your friendly neighborhood hacker</description>
	<lastBuildDate>Mon, 05 Apr 2010 09:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Removing editor swap files before commits in git</title>
		<link>http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/</link>
		<comments>http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 01:07:03 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/</guid>
		<description><![CDATA[I use git a lot. And I use just about any text editor in my system to edit files. And they tend to come with baggages of their own. Albeit useful, the swap files tend to linger on and eventually end up in my git repository. Here&#8217;s how to avoid that scenario.
Git (okay I remember [...]]]></description>
			<content:encoded><![CDATA[<p>I use git a lot. And I use just about any text editor in my system to edit files. And they tend to come with baggages of their own. Albeit useful, the swap files tend to linger on and eventually end up in my git repository. Here&#8217;s how to avoid that scenario.<br />
Git (okay I remember this from doing the same thing in subversion, so nothing new) has something called pre-commit. Pre-commit is just a script/action you can perform on the repository before committing. So, here&#8217;s what you need to do<br />
I&#8217;ll use vim here, but use whatever you like<br />
$ vim .git/hooks/pre-commit<br />
and put this:<br />
#!/bin/sh<br />
find . -name &#8216;*~&#8217; -exec rm \;<br />
find . -name &#8216;*.swp&#8217; -exec rm \;</p>
<p>This removes two types of files, those generated by vim and gedit. There should be a much more elegant way to include more file types, I&#8217;ll update them as I refine my pre-commit hook more. <img src='http://www.nextdoorhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making scripts executable with vim hooks</title>
		<link>http://www.nextdoorhacker.com/2009/07/making-scripts-executable-with-vim-hooks/</link>
		<comments>http://www.nextdoorhacker.com/2009/07/making-scripts-executable-with-vim-hooks/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 01:13:10 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[automation]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/?p=155</guid>
		<description><![CDATA[I write a lot of shell, python and sometimes perl scripts to get things done and it gets somewhat mildly annoying to set them as executable every once in a while. Here&#8217;s a trick from shell-fu Tip #858
I just added the following line to my ~/.vimrc
au BufWritePost * if getline(1) =~ &#8220;^#!&#8221; &#124; if getline(1) [...]]]></description>
			<content:encoded><![CDATA[<p>I write a lot of shell, python and sometimes perl scripts to get things done and it gets somewhat mildly annoying to set them as executable every once in a while. Here&#8217;s a trick from <a href="http://www.shell-fu.org/lister.php?id=858">shell-fu Tip #858</a></p>
<p>I just added the following line to my ~/.vimrc</p>
<blockquote><p>au BufWritePost * if getline(1) =~ &#8220;^#!&#8221; | if getline(1) =~ &#8220;/bin/&#8221; | if getline(1) =~ &#8220;/usr/bin&#8221; | silent !chmod a+x &lt;afile&gt; | endif | endif</p></blockquote>
<p>I have improved the script a little bit as I need to use python a lot (i.e, #!/usr/bin/env python)</p>
<p>If you have a better way to write the regex, comment here but I think this is good enough for most purposes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2009/07/making-scripts-executable-with-vim-hooks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
