<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: VIM Tip of the Day: leave python comments indented, don&#8217;t put cursor at beginning of the line</title>
	<atom:link href="http://www.mike-griffith.com/blog/2009/05/vim-tip-of-the-day-leave-python-comments-indented-dont-put-cursor-at-beginning-of-the-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mike-griffith.com/blog/2009/05/vim-tip-of-the-day-leave-python-comments-indented-dont-put-cursor-at-beginning-of-the-line/</link>
	<description>on software, testing, and the web.</description>
	<lastBuildDate>Mon, 14 Jun 2010 12:27:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mike</title>
		<link>http://www.mike-griffith.com/blog/2009/05/vim-tip-of-the-day-leave-python-comments-indented-dont-put-cursor-at-beginning-of-the-line/comment-page-1/#comment-1332</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 24 Feb 2010 05:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.mike-griffith.com/blog/?p=305#comment-1332</guid>
		<description>Jonathan: Thanks for the thorough reply!

The only value I seem to get from  smartindent is what you mentioned -- the comment formatting (which admittedly is still hokey, even with this kludge).

I did already have the `filetype plugin indent on`, but had the softtabstop/shiftwidth/etc. inline in the .vimrc, rather than externalized in `ftplugin/python.vim`

Looks like it&#039;s time to clean up my .vimrc.</description>
		<content:encoded><![CDATA[<p>Jonathan: Thanks for the thorough reply!</p>
<p>The only value I seem to get from  smartindent is what you mentioned &#8212; the comment formatting (which admittedly is still hokey, even with this kludge).</p>
<p>I did already have the `filetype plugin indent on`, but had the softtabstop/shiftwidth/etc. inline in the .vimrc, rather than externalized in `ftplugin/python.vim`</p>
<p>Looks like it&#8217;s time to clean up my .vimrc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.mike-griffith.com/blog/2009/05/vim-tip-of-the-day-leave-python-comments-indented-dont-put-cursor-at-beginning-of-the-line/comment-page-1/#comment-1260</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Tue, 23 Feb 2010 04:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mike-griffith.com/blog/?p=305#comment-1260</guid>
		<description>But the question is, &lt;i&gt;why&lt;/i&gt; would you want to leave smartindent on when editing python (or anything for that matter)? I&#039;m sure an indent feature with a few hard-coded rules for C-like languages was awesome back in the &#039;80s ;P but we&#039;ve moved on since then. Vim has real python specific indentation support, which is actually intelligent and actually tailored to the language in question.

Just put &quot;filetype plugin indent on&quot; in your vimrc and make sure smartindent is off (it interferes with filetype indentation). Leaving autoindent on can be nice for consistent formatting in comments (it just carries the previous line&#039;s indentation to a new line, if the python indentation support doesn&#039;t override it because you just entered a new code block).

You&#039;ll also want to setup your PEP8-friendly softtabstop, shiftwidth, expandtab, smarttab, etc. settings. I&#039;d recommend doing that inside a .vim/ftplugin/python/pep8.vim file, which will be auto-loaded anytime you edit a python language file.

You could stick a &quot;setlocal nosmartindent&quot; in that pep8.vim file if you wanted to keep smartindent on for everything except python, but I think you&#039;ll find that vim&#039;s filetype indentation will have support for and be superior to smartindent for nearly every language around.</description>
		<content:encoded><![CDATA[<p>But the question is, <i>why</i> would you want to leave smartindent on when editing python (or anything for that matter)? I&#8217;m sure an indent feature with a few hard-coded rules for C-like languages was awesome back in the &#8217;80s ;P but we&#8217;ve moved on since then. Vim has real python specific indentation support, which is actually intelligent and actually tailored to the language in question.</p>
<p>Just put &#8220;filetype plugin indent on&#8221; in your vimrc and make sure smartindent is off (it interferes with filetype indentation). Leaving autoindent on can be nice for consistent formatting in comments (it just carries the previous line&#8217;s indentation to a new line, if the python indentation support doesn&#8217;t override it because you just entered a new code block).</p>
<p>You&#8217;ll also want to setup your PEP8-friendly softtabstop, shiftwidth, expandtab, smarttab, etc. settings. I&#8217;d recommend doing that inside a .vim/ftplugin/python/pep8.vim file, which will be auto-loaded anytime you edit a python language file.</p>
<p>You could stick a &#8220;setlocal nosmartindent&#8221; in that pep8.vim file if you wanted to keep smartindent on for everything except python, but I think you&#8217;ll find that vim&#8217;s filetype indentation will have support for and be superior to smartindent for nearly every language around.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
