vim newb - indenting python comments

Tim Chase python.list at tim.thechases.com
Fri Jan 4 21:07:51 EST 2008


> One problem I have is that the >> indent in normal mode doesn't work
> when a line starts with the # character.  Any idea what I'm doing
> wrong?

In short, ">>" *does* indent in normal mode (I presume you
accurately mean "Normal" mode, rather than "Insert" mode).  The
question becomes why doesn't it work in your particular copy of Vim?

To evidence this, start vim with

  vim -u NONE myfile.py

(which bypasses startup files) and you'll see that >> does indeed
shift commented lines.

To track down the problem, you'll need to provide a little more
info.  Starting Vim the way you normally do, pointed at a
problematic python file, what is the output of

  :scriptnames

What mappings do you have defined:

  :nmap

(particularly any mappings for ">" and its kin).

What are your filetype settings:

  :filetype

What are your settings for 'indentkeys', 'indentexpr',
'shiftwidth', 'tabstop', 'expandtab' and 'filetype'

  :set indentkeys? indentexpr? sw? ts? et? ft?

Which version of Vim are you using:

  :version

Hopefully some of those will point you at the problem child.
Otherwise, drop by the Vim mailing list and there are a lot of
other smart cookies there that may have other ideas.

-tkc








More information about the Python-list mailing list