On Oct 27, 10:50 pm, Barry Gold <[EMAIL PROTECTED]> wrote:
> I'm using vim 7.1. I'm editing a Javascript program (*.js), which
> allows C++ style on-linecomments: //
>
> I want to have thesecommentsauto-formatted -- put auto wrap at wm=,
> then start the next line with //.
>
> I have read the help documentation and tried settingformatoptions,
> comment, andcommentstring, but so far without success.
>
> And yes, I've looked at the FAQ and the message archive. Any help would
> be appreciated. Oh, just in case my .exrc file is causing trouble, here
> it is:
> set autoindent
> set nohls
> syntax off
> set wm=5
> set nobk
> set ws
> set ic
> set ts=8
> set sw=4
> map ^V^N :n^V^M That is, ctrl-N = :n
> map ^V^W :w^V^M^V^N That is, ctrl-W = :w + :n
> :map ^K :w^V^M:e #^V^M That is, ctrl-K = :w + :e #
> map v k$hjl
> map q F r
> map g f r
> map = 3k$h3jl
You have read the documentation for the correct options, but do not
set them anywhere in you .exrc file.
>From the fact that you are using an .exrc file (as opposed to a .vimrc
file), and the fact that no-where in your .exrc file do you "set
nocompatible", you are probably running in vi-compatible mode. Many
advanced Vim features are disabled by default, and many are enabled
simply by setting non vi-compatible mode. I would suggest that you do
this.
In particular, the default values of 'formatoptions' in compatible
mode may cause you some trouble. 'comments' says that it is "not in
vi", but it seems to be set correctly when running Vim in compatible
mode, so I'm not sure if this option is affected.
Frankly, I've only ever ran Vim in compatible mode by accident. I
would highly suggest creating a vimrc to automatically use non-
compatible mode, or explicitly setting nocompatible.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---