On 2006-10-18, eric1235711 <[EMAIL PROTECTED]> wrote:

> Yakov Lerner-3 wrote:
> > 
> > On 10/18/06, eric1235711 <[EMAIL PROTECTED]> wrote:
> >>
> >> Hello
> >>
> >> I´m PHP programmer and I started programming in gVim last weak, and I´m
> >> liking it very much
> >>
> >> But I got a trouble...
> >>
> >> When I´m commenting (// or /* or #) and I type <SPACE> it breaks the line
> >> automatically. Always I start a comment, i have to go to normal mode and
> >> type :set nosta<CR> :set noai<CR> :set nosi<CR>
> >>
> >> I find that only nosta or nosi is enought to make it stop breaking the
> >> line
> >> automatically, but I want to configure to it stop doing it forever...
> >>
> >> I took a look in syntax/php.vim but I just don´t know where correct it...
> >>
> >> Do you have any idea of how I fix it?
> > 
> > Does this help:
> >    :set tw=0
> > ?

> I can fix it when I´m programming, i´m doing it... but I´m getting tired of
> doing that.
> 
> I want to alter the syntax file (or what ever else) to fix it permanently.

First of all, don't alter any of the files that are in the
$VIMRUNTIME directory.  For Vim-7.0 on Windows, this is commonly

    C:\Program Files\Vim\vim70

Doing so will cause you to lose those changes when you upgrade your
vim installation.

The way to fix this problem is to create two new directories:

    $VIM\vimfiles\after
    $VIM\vimfiles\after\ftplugin

on Windows or

    ~/.vim/after
    ~/.vim/after/ftplugin

on Unix.  Then create a new file in the after/ftplugin directory
named php.vim and put in it those commands that fix the problem,
e.g.,

    setlocal nosta
    setlocal noai
    setlocal nosi

Note the use of "setlocal" instead of "set".  This will keep those
changes local to your PHP buffer(s) so that you can use other
settings in other buffers you might have open at the same time.

See:

    :help ftplugin-overrule
    :help ftplugin

HTH,
Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | Wireless Division
                             | Spokane, Washington, USA

Reply via email to