Vim's smartindent was designed mainly with C in mind. In C, the '#' is used for preprocessor directives, which are usually placed at the beginning of the line (I think some versions of the C preprocessor even require them to be at the beginning of the line, but I'm not sure).
Added: Yep, it seems that "traditional" C only recognized preprocessor directives in column 1. With gcc, you can emulate this behavior by supplying the '-traditional-cpp' option. | [reply] |
>why would anyone want their comment to the far left no matter
>what? Is there some common commenting idiom I am missing?
Usually, programmers do their programming with intermediate checks, by commenting the checks and removing them when they wish to check the code.This will be tiresome if some one want to search for the # symbols some where inside the code,
So It becomes kind of an easy,rule to keep the comments at the beginning of the line.
Best
Vasundhar | [reply] |