Bug 837637 - vim cannot indent C files
Summary: vim cannot indent C files
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-04 13:55 UTC by hramrach
Modified: 2012-08-28 14:15 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-28 11:36:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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