Bug 837637 - vim cannot indent C files
vim cannot indent C files
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: vim (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Karsten Hopp
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-04 09:55 EDT by hramrach
Modified: 2012-08-28 10:15 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-28 07:36:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description hramrach 2012-07-04 09:55:10 EDT
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 10:10:31 EDT
seems to be the case in compatible mode only
Comment 2 Karsten Hopp 2012-08-28 07:36:50 EDT
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 10:15:50 EDT
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.

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