Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 161177 - Automatic indentation doesn't work at all in vim
Summary: Automatic indentation doesn't work at all in vim
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-21 04:15 UTC by Chris Gonnerman
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-06-21 09:40:10 UTC

Attachments (Terms of Use)

Description Chris Gonnerman 2005-06-21 04:15:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Description of problem:
No matter what I do, I can't get the automatic indentation to work in VIM.  I've tried with both Python and C source files, and when I start a new block it does not indent, nor does it "dedent" when I close a block in C.  Whatever indentation level it is at, it stays there for each new line until I change it.

I tried first with a stock install, then created a .vimrc containing the following:

set autoindent
set expandtab
set smarttab
set sw=4
set ts=4
set showmatch

Neither way works at all.  This works fine on my SuSE 6.3 system.

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
Start VIM with a source file that should be indented, like test.c.  Type in a properly-formatted function definition (for example) and note that the automatic indent doesn't happen when you start the block (with the open-curly).

Actual Results:  It didn't indent.

Expected Results:  It should have indented one tab-stop (four spaces with the vimrc described above).

Additional info:

Comment 1 Chris Gonnerman 2005-06-21 04:25:48 UTC
Never mind.  I just discovered the difference between vim-enhanced and
vim-minimal, namely that typing "vi" isn't the same as typing "vim" at the prompt.

This REALLY ought to be in the FAQ, as I looked there first.

Comment 2 Karsten Hopp 2005-06-21 09:40:10 UTC
Closing as NOTABUG based on last comment.

BTW: You might want to use smartindent or cindent, whichever better matches
your programming style. From the vim manual:

There are in fact four methods available for indentation:
'autoindent'	uses the indent from the previous line.
'smartindent'	is like 'autoindent' but also recognizes some C syntax to
		increase/reduce the indent where appropriate.
'cindent'	Works more cleverly than the other two and is configurable to
		different indenting styles.
'indentexpr'	The most flexible of all: Evaluates an expression to compute
		the indent of a line.  When non-empty this method overrides
		the other ones.  See |indent-expression|.

Note You need to log in before you can comment on or make changes to this bug.