Bug 837637

Summary: vim cannot indent C files
Product: [Fedora] Fedora Reporter: hramrach
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: karsten
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-28 11:36:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description hramrach 2012-07-04 13:55:10 UTC
When editing a C file in vim it is not possible to use vim autoindentation.

vim calls external indent program to perform the function.

however

1) indent is not a dependency of vim

2) it cannot be used on code snippets (as vim tries to), probably requires whole files

Comment 1 hramrach 2012-07-04 14:10:31 UTC
seems to be the case in compatible mode only

Comment 2 Karsten Hopp 2012-08-28 11:36:50 UTC
that's intentional and documented in the vim help (:h compatible). compatible mode disables cindent and that's what does most of the autoindent stuff. Without cindent you'll get only the same indents that the last line had, but no automatic indentation of braces and such.

btw: vim has its own indent implementation and doesn't need an external indent program. You can still use it with p.e. :'<,'>!indent  (after you've marked a range with 'V')

Comment 3 hramrach 2012-08-28 14:15:50 UTC
The problem here is that indentation commands (=) call non-existent binary and instead of indenting remove text. I don't see how that is derived from the description of compatible mode.

The description of = says that internal indentation is used when compiled in. I don't see where it says that in compatible mode it will pretend this is not compiled in and instead of formatting text filter it through non-existent command and remove it as a consequence.