A.J.Mechelynck wrote:
Robert Lee wrote:
I have a gvim 7.0 (win32 with +comments) that seems to be ignoring the "set comments" line in my .vimrc file. I can submit the entire .vimrc file if desired but the relevant line is:

set comments=s:/**,mb:*,ex:*/

What I get is this (vim default?):

/*
**
**
*/

and what I expect is this (phpdoc standard syntax):

/**
*
*
*/

This seems to indicate that vim was compiled without +comments but according to :version (posted below), this directive was included. This is an unmodified gvim binary as downloaded very recently from vim.org.

I doubt that this is a bug, but I don't see what else could be causing this.

Thanks for any help!

-Robert

I haven't delved very deep into the 'comments' options. In CSS files it is set (by the ftplugin, I guess) to
    comments=s1:/*,mb:*,ex:*/

and I get

/*
 *
 *
 */

With your settings, I see
/**
*__
*__
*/

where the underscores represent spaces which are removed if I add no text; but there must be some other relevant settings, because I see it if I do it after ":set ft=css" but not in a virgin [No Name] buffer, where Vim adds no comment leader.

-- Are you sure you typed _both_ asterisks after the slash in the first comment line?


Best regards,
Tony.

Tony, thanks for your help.

I discovered that the problem was caused by the lines:

au BufWinLeave * mkview
au BufWinEnter * silent loadview

Apparently the view file that is created contains a copy of the vimrc settings. This prevents changes to the vimrc to be honored once a file has been opened. The temporary fix was to clean up the "vimfiles/view" directory. I think the right fix is to move these files to the very top of the vimrc file, but I am skeptical that this will help at all. I wish mkview only saved folds/marks/cursor position information instead of a full vimrc copy. I also discovered an unrelated error caused by these lines, which is fixed by using:

au BufWinLeave *.* mkview
au BufWinEnter *.* silent loadview

...instead.

Hope some of this helps someone else with similar problems (e.g. vimrc changes being ignored for existing files).

-Robert

Reply via email to