in reply to Re: Slightly Off Topic: vim/perl comment behavior
in thread Slightly Off Topic: vim/perl comment behavior

Thank you. I didn't make the connection between smartindent and the behavior, probably because the behavior was not smart :) This fixed my issue.

As an aside, why would anyone want their comment to the far left no matter what? Is there some common commenting idiom I am missing?
  • Comment on Re^2: Slightly Off Topic: vim/perl comment behavior

Replies are listed 'Best First'.
Re^3: Slightly Off Topic: vim/perl comment behavior
by itub (Priest) on Aug 23, 2005 at 18:27 UTC
    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.

Re^3: Slightly Off Topic: vim/perl comment behavior
by vasundhar (Acolyte) on Aug 24, 2005 at 10:32 UTC
    >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