Wednesday, April 4, 2012

Re: indenting python docstring in vim

On Apr 4, 2012, at 1:12 PM, Zetah Ghamin wrote:

> Did not work.
>
> I already have filetype indent on. When I first noticed this problem, that's what I checked with the command filetype:
> filetype detection:ON plugin:ON indent:ON

Something in your or system setup is changing the default indentation.

> I believe this is being turn on by /etc/vimrc.

Perhaps something else is being turned on that has a negative impact.

> I will try to move rc files around to see if there is any effect.

This should work with a bare default Vim setup. I suggest the following:

- Put your function (and class) in a file and indent it manually to look right
(e.g., four space indent for the whole docstring and a pass below it).
- Move away your .vim, .vimrc, and .gvimrc files.
- Run "touch .vimrc" from the command line to ensure "nocompatible" mode
- Try to re-indent the content of the file with your function.

This should cause bad indentation.

- Add to .vimrc just:

if has("autocmd")
filetype plugin indent on
autocmd FileType python setl sw=4 sts=4 et
endif

- Try the file with your function again.

This must produce right indentation if filetype shows plugin and indent are on.

If that produces the right indent, try to gradually add your personal Vim files, especially Python related features, until you find the culprit.

If that doesn't produce the right indent, your personal Vim setup is probably fine and something is wrong with the system settings.
Try reviewing and moving those until you find the one that causes the problem.

The files to look at are: /usr/share/vim/vimrc and it seems /etc/vimrc on your Linux systems at least.

Also check if anything is triggering /usr/local/share/vim/vimXY/indoff.vim where XY is your Vim version (e.g. 73)

Regards,

Zvezdan

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: