<?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>AmirWatad.com &#187; Vim</title>
	<atom:link href="http://www.amirwatad.com/blog/archives/category/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amirwatad.com/blog</link>
	<description>Remember the name ;)</description>
	<lastBuildDate>Wed, 22 Sep 2010 22:04:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Make Vim Remember The Cursor&#8217;s Last Position After Exiting</title>
		<link>http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/</link>
		<comments>http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 18:37:14 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=618</guid>
		<description><![CDATA[So you edit a file in vim, you exit vim, and after a while you want to edit the file again. Many times it&#8217;s nice to have the cursor placed in the same position you left it. Here&#8217;s how to make this happen: 1. Add this to your ~/.vimrc file  (or to /etc/vim/vimrc to enable [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/">Make Vim Remember The Cursor&#8217;s Last Position After Exiting</a></p>
]]></description>
			<content:encoded><![CDATA[<p>So you edit a file in vim, you exit vim, and after a while you want to edit the file again. Many times it&#8217;s nice to have the cursor placed in the same position you left it. Here&#8217;s how to make this happen:</p>
<p>1. Add this to your ~/.vimrc file  (or to /etc/vim/vimrc to enable to the feature system-wide):</p>
<blockquote>
<div id="_mcePaste">if has(&#8220;autocmd&#8221;)</div>
<div id="_mcePaste">au BufReadPost * if line(&#8220;&#8216;\&#8221;") &gt; 1 &amp;&amp; line(&#8220;&#8216;\&#8221;") &lt;= line(&#8220;$&#8221;) | exe &#8220;normal! g`\&#8221;" | endif</div>
<div id="_mcePaste">endif</div>
</blockquote>
<div>2. Check if the file ~/.viminfo  exists. If it doesn&#8217;t, create it:</div>
<blockquote>
<div>touch ~/.viminfo</div>
</blockquote>
<p><span id="more-618"></span>3. Make sure that you own ~/.viminfo  - sometimes it&#8217;s owned by root for some reason! If this is the case, make it yours:</p>
<blockquote><p>chown your_username ~/.viminfo</p></blockquote>
<p>Note:</p>
<p>Sometimes you&#8217;ll find the above snippet already placed in /etc/vim/vimrc  (sometimes commented). If it&#8217;s there, uncomment it, and make sure that it reads the same as above.</p>
<p>In Ubuntu 10.04, I uncommented the above snippet in /etc/vim/vimrc. The cursor was placed on the correct line, but always placed in the beginning of the line. This is sub-optimal since the desired behavior is to place it in the correct line and column.</p>
<p>After some Googling, I found that the problem is in this part:</p>
<blockquote><p>exe &#8220;normal! g`\&#8221;"</p></blockquote>
<p>In Ubuntu 10.04, The &#8220;g&#8221; is followed by a <a title="Wikipedia - Quotation Mark" href="http://en.wikipedia.org/wiki/Quotation_mark" target="_blank">single quote</a>. It should be followed by a <a title="Wikiepdia Backtick" href="http://en.wikipedia.org/wiki/Backtick" target="_blank">backtick</a></p>
<p>Have fun <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' title="Make Vim Remember The Cursors Last Position After Exiting" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/">Make Vim Remember The Cursor&#8217;s Last Position After Exiting</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Make+Vim+Remember+The+Cursor%E2%80%99s+Last+Position+After+Exiting+http://bit.ly/c7rqaY" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Make Vim Remember The Cursors Last Position After Exiting" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/&amp;title=Make+Vim+Remember+The+Cursor%E2%80%99s+Last+Position+After+Exiting" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Make Vim Remember The Cursors Last Position After Exiting" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/&amp;title=Make+Vim+Remember+The+Cursor%E2%80%99s+Last+Position+After+Exiting" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Make Vim Remember The Cursors Last Position After Exiting" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/&amp;t=Make+Vim+Remember+The+Cursor%E2%80%99s+Last+Position+After+Exiting" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Make Vim Remember The Cursors Last Position After Exiting" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/&amp;title=Make+Vim+Remember+The+Cursor%E2%80%99s+Last+Position+After+Exiting" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Make Vim Remember The Cursors Last Position After Exiting" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/&amp;title=Make+Vim+Remember+The+Cursor%E2%80%99s+Last+Position+After+Exiting" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Make Vim Remember The Cursors Last Position After Exiting" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2010/09/09/make-vim-remember-the-cursors-last-position-after-exiting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fix Bad Indentation When Pasting Text To Vim</title>
		<link>http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/</link>
		<comments>http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 19:27:01 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=583</guid>
		<description><![CDATA[The problem is this: You&#8217;re editing a buffer in vim, you copy a text (say, code snippet) from another place (say, Firefox), and you paste it inside vim (with middle mouse button / shift+insert). Most chances you won&#8217;t like what vim has just did to your text. The problem is that vim doesn&#8217;t &#8220;know&#8221; that [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/">Fix Bad Indentation When Pasting Text To Vim</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The problem is this:</p>
<p>You&#8217;re editing a buffer in vim, you copy a text (say, code snippet) from another place (say, Firefox), and you paste it inside vim (with middle mouse button / shift+insert). Most chances you won&#8217;t like what vim has just did to your text.</p>
<p>The problem is that vim doesn&#8217;t &#8220;know&#8221; that you&#8217;re actually pasting a text, and it thinks that you&#8217;re typing. So, if you have indentation enabled, it will re-indent your text.</p>
<p>The solution is simple: Whenever you want to paste text from outside vim into vim. Type this in command mode:</p>
<blockquote><p>:set paste</p></blockquote>
<p>So now vim knows that you&#8217;re going to paste text, and it will not touch it.</p>
<p>To disable the paste mode:</p>
<blockquote><p>:set nopaste</p></blockquote>
<p>As easy as that <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' title="Fix Bad Indentation When Pasting Text To Vim" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/">Fix Bad Indentation When Pasting Text To Vim</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Fix+Bad+Indentation+When+Pasting+Text+To+Vim+http://bit.ly/b3q5o7" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Fix Bad Indentation When Pasting Text To Vim" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/&amp;title=Fix+Bad+Indentation+When+Pasting+Text+To+Vim" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Fix Bad Indentation When Pasting Text To Vim" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/&amp;title=Fix+Bad+Indentation+When+Pasting+Text+To+Vim" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Fix Bad Indentation When Pasting Text To Vim" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/&amp;t=Fix+Bad+Indentation+When+Pasting+Text+To+Vim" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Fix Bad Indentation When Pasting Text To Vim" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/&amp;title=Fix+Bad+Indentation+When+Pasting+Text+To+Vim" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Fix Bad Indentation When Pasting Text To Vim" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/&amp;title=Fix+Bad+Indentation+When+Pasting+Text+To+Vim" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Fix Bad Indentation When Pasting Text To Vim" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2010/07/16/fix-bad-indentation-when-pasting-text-to-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NumPad Problems When Using Vim over Tmux</title>
		<link>http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/</link>
		<comments>http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 22:53:34 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tmux]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=579</guid>
		<description><![CDATA[I use vim as my main text editor, and I usually split the screen to edit a few buffers in parallel. To make resizing the windows faster, I mapped the numpad keys &#8220;/*-+&#8221; to resize the windows (see original vim tip here). Recently, I started to use tmux, and opened vim, split the windows as [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/">NumPad Problems When Using Vim over Tmux</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I use vim as my main text editor, and I usually split the screen to edit a few buffers in parallel. To make resizing the windows faster, I mapped the numpad keys &#8220;/*-+&#8221; to resize the windows (see original vim tip <a title="VimTip - resizing windows" href="http://vim.wikia.com/wiki/VimTip427" target="_blank">here</a>).</p>
<p>Recently, I started to use tmux, and opened vim, split the windows as usual, and tried to resize them. It didn&#8217;t work <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="NumPad Problems When Using Vim over Tmux " /> </p>
<p>I use Ubuntu 10.04 (Don&#8217;t remember the exotic name..), and I found that the latest tmux package in their repo is 1.1-1.</p>
<p>Anyway, version 1.1-1 has a bug with the NumPad. The solution is to download the source of tmux 1.2 and build it. It depends on libevent so you&#8217;ll need to get it first:</p>
<p>this is how to make it work:</p>
<blockquote><p>1. sudo apt-get install libevent-dev</p>
<p>2. Get the source tarball of tmux from <a title="http://sourceforge.net/projects/tmux/files/tmux/tmux-1.2/tmux-1.2.tar.gz/download" href="http://" target="_blank">here</a>.</p>
<p>3. tar xzf tmux-1.2.tar.gz</p>
<p>4. cd tmux-1.2</p>
<p>5. ./configure</p>
<p>6. make</p>
<p>7. sudo make install</p></blockquote>
<p>Done. Now your life is better. Have fun <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' title="NumPad Problems When Using Vim over Tmux " /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/">NumPad Problems When Using Vim over Tmux</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=NumPad+Problems+When+Using+Vim+over+Tmux+http://bit.ly/d8qiIw" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="NumPad Problems When Using Vim over Tmux " /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/&amp;title=NumPad+Problems+When+Using+Vim+over+Tmux" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="NumPad Problems When Using Vim over Tmux " /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/&amp;title=NumPad+Problems+When+Using+Vim+over+Tmux" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="NumPad Problems When Using Vim over Tmux " /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/&amp;t=NumPad+Problems+When+Using+Vim+over+Tmux" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="NumPad Problems When Using Vim over Tmux " /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/&amp;title=NumPad+Problems+When+Using+Vim+over+Tmux" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="NumPad Problems When Using Vim over Tmux " /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/&amp;title=NumPad+Problems+When+Using+Vim+over+Tmux" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="NumPad Problems When Using Vim over Tmux " /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2010/07/03/numpad-problems-when-using-vim-over-tmux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vim Tip &#8211; Convert Code To HTML</title>
		<link>http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/</link>
		<comments>http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 19:10:59 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[Syntax Highlighting]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=558</guid>
		<description><![CDATA[If you wrote some elegant code, and want to publish it as a HTML page, you can easily do that in vim: In command mode, type this: :TOhtml A new buffer will be opened with the HTML source, just save it: :wq If the original file name was &#8220;mycode.c&#8221;, you&#8217;ll find a new file in [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/">Vim Tip &#8211; Convert Code To HTML</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you wrote some elegant code, and want to publish it as a HTML page, you can easily do that in vim:<br />
In command mode, type this:</p>
<blockquote><p>
:TOhtml
</p></blockquote>
<p>A new buffer will be opened with the HTML source, just save it:</p>
<blockquote><p>
:wq
</p></blockquote>
<p>If the original file name was &#8220;mycode.c&#8221;, you&#8217;ll find a new file in the same directory named &#8220;mycode.c.html&#8221;. Open it with your favourite web browser.</p>
<p>Wow, not?<br />
Have fun <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' title="Vim Tip   Convert Code To HTML" />  </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/">Vim Tip &#8211; Convert Code To HTML</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Vim+Tip+%E2%80%93+Convert+Code+To+HTML+http://bit.ly/aPacpt" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Vim Tip   Convert Code To HTML" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/&amp;title=Vim+Tip+%E2%80%93+Convert+Code+To+HTML" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Vim Tip   Convert Code To HTML" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/&amp;title=Vim+Tip+%E2%80%93+Convert+Code+To+HTML" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Vim Tip   Convert Code To HTML" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/&amp;t=Vim+Tip+%E2%80%93+Convert+Code+To+HTML" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Vim Tip   Convert Code To HTML" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/&amp;title=Vim+Tip+%E2%80%93+Convert+Code+To+HTML" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Vim Tip   Convert Code To HTML" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/&amp;title=Vim+Tip+%E2%80%93+Convert+Code+To+HTML" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Vim Tip   Convert Code To HTML" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2010/04/24/vim-tip-convert-code-to-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Shell Scripts Executable By Default</title>
		<link>http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 21:05:34 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripts]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=521</guid>
		<description><![CDATA[If you use vim to write shell scripts, you might want to save the &#8220;chmod +x&#8221; command after saving the script. By adding the following line to your vimrc file (typically, it&#8217;s located at ~/.vimrc), scripts will automatically become executable. au BufWritePost * if getline(1) =~ &#8220;^#!&#8221; &#124; if getline(1) =~ &#8220;/bin/&#8221; &#124; silent !chmod [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/">Make Shell Scripts Executable By Default</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you use vim to write shell scripts, you might want to save the &#8220;chmod +x&#8221; command after saving the script.</p>
<p>By adding the following line to your vimrc file (typically, it&#8217;s located at ~/.vimrc), scripts will automatically become executable.</p>
<blockquote><p>au BufWritePost * if getline(1) =~ &#8220;^#!&#8221; | if getline(1) =~ &#8220;/bin/&#8221; | silent !chmod a+x &lt;afile&gt;  | endif | endif</p></blockquote>
<p>(meaning, if the file includes #! with &#8220;/bin/&#8221; in the path, apply &#8220;chmod a+x&#8221; on this file).</p>
<p>via <a href="http://www.shell-fu.org/lister.php?id=858">shell-fu</a>.</p>
<p>Have fun <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Make Shell Scripts Executable By Default" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/">Make Shell Scripts Executable By Default</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Make+Shell+Scripts+Executable+By+Default+http://bit.ly/ZmgzE" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Make Shell Scripts Executable By Default" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/&amp;title=Make+Shell+Scripts+Executable+By+Default" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Make Shell Scripts Executable By Default" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/&amp;title=Make+Shell+Scripts+Executable+By+Default" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Make Shell Scripts Executable By Default" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/&amp;t=Make+Shell+Scripts+Executable+By+Default" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Make Shell Scripts Executable By Default" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/&amp;title=Make+Shell+Scripts+Executable+By+Default" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Make Shell Scripts Executable By Default" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/&amp;title=Make+Shell+Scripts+Executable+By+Default" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Make Shell Scripts Executable By Default" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/09/26/make-shell-scripts-executable-by-default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edit The Command Line With Vim</title>
		<link>http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/</link>
		<comments>http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 21:44:26 +0000</pubDate>
		<dc:creator>Amir Watad</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.amirwatad.com/blog/?p=456</guid>
		<description><![CDATA[This is a quick (and great) tip I found at Daily Vim: Open a linux terminal, and type some (long) command. Now type [ctrl]+[x] and then [ctrl]+[e] The command should be moved now to a vim window. Edit the command (fix typos, change parameters, etc..) and save. The command will now be executed. Enjoy --------- [...]<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/">Edit The Command Line With Vim</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This is a quick (and great) tip I found at <a href="http://dailyvim.blogspot.com/2009/06/easier-command-line-editing.html">Daily Vim</a>:</p>
<p>Open a linux terminal, and type some (long) command.<br />
Now type [ctrl]+[x] and then [ctrl]+[e]<br />
The command should be moved now to a vim window.<br />
Edit the command (fix typos, change parameters, etc..) and save.<br />
The command will now be executed.<br />
Enjoy <img src='http://www.amirwatad.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Edit The Command Line With Vim" /> </p>
<p>---------
Note:
Some RSS readers might display this post with incorrect format.
View original post at <a href="http://www.amirwatad.com/blog">AmirWatad.com </a><br/><br/><a href="http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/">Edit The Command Line With Vim</a></p>
<p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Edit+The+Command+Line+With+Vim+http://bit.ly/qGNF3" title="Post to Twitter"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" style="margin:0;" title="Edit The Command Line With Vim" /></a> <a target="_blank" class="tt" href="http://delicious.com/post?url=http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/&amp;title=Edit+The+Command+Line+With+Vim" title="Post to Delicious"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-delicious-big3.png" alt="Post to Delicious" style="margin:0 0 0 2px;" title="Edit The Command Line With Vim" /></a> <a target="_blank" class="tt" href="http://digg.com/submit?url=http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/&amp;title=Edit+The+Command+Line+With+Vim" title="Post to Digg"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big3.png" alt="Post to Digg" style="margin:0 0 0 2px;" title="Edit The Command Line With Vim" /></a> <a target="_blank" class="tt" href="http://www.facebook.com/share.php?u=http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/&amp;t=Edit+The+Command+Line+With+Vim" title="Post to Facebook"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-facebook-big3.png" alt="Post to Facebook" style="margin:0 0 0 2px;" title="Edit The Command Line With Vim" /></a> <a target="_blank" class="tt" href="http://reddit.com/submit?url=http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/&amp;title=Edit+The+Command+Line+With+Vim" title="Post to Reddit"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-reddit-big3.png" alt="Post to Reddit" style="margin:0 0 0 2px;" title="Edit The Command Line With Vim" /></a> <a target="_blank" class="tt" href="http://stumbleupon.com/submit?url=http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/&amp;title=Edit+The+Command+Line+With+Vim" title="Post to StumbleUpon"><img class="nothumb" src="http://www.amirwatad.com/blog/wp-content/plugins/tweet-this/icons/tt-su-big3.png" alt="Post to StumbleUpon" style="margin:0 0 0 2px;" title="Edit The Command Line With Vim" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.amirwatad.com/blog/archives/2009/06/01/edit-the-command-line-with-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.916 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-05 15:58:06 -->

