astropanic wrote:
HI,
I run Vim6.3 on Debian Sarge 3.1 from the testing packages. How I can set it
up to autocomment lines ? Example:

/** - this line is written by me, on every newline character entered from
the keyboard ...
 *
 * - vim should draw a asterisk on the screen and let me continue write the
commented block
 *
 */ - until I write this sequence, then
Vim should exit from the comment block and don,t more write asterisk on the
newline

This Vim version is compiled with the '+comments' flag.
I have tried the :set comments=sr/**,m:*,elx:*/ , but with no results.
I often use PHP and PHPDocumentor, and a really need this thing.

On the Slackware 11 distro with Vim7 this works fine for me.
Can anybody help ?
Thanks

        :setlocal comments=sr/**,m:*,elx:*
E539: Illegal character </>

        :setlocal comments=sr:/**,m:*,elx:*
no error but doesn't work
        :setlocal fo+=cr
inserting middle part now works (right-aligned with comment start). Typing just / removes the space before it but Vim still inserts a * on next line.

        :setlocal comments=sr:/**,mb:*,ex:*
        " with 'formatoptions' including cr
works:

/** line 1                    <-- all hand-typed
  * line 2                    <-- hand-typed starting with l
  * line 3                    <-- ditto
  */                          <-- only / hand-typed, no need to backspace
                              <-- Vim doesn't auto-insert anything here


I'm using gvim 7.0.188 with GTK2/Gnome GUI on SuSE Linux 9.3.


Best regards,
Tony.

Reply via email to