Loading ...
Sorry, an error occurred while loading the content.
 

comment block weirdness with php filetype

Expand Messages
  • Ian Young
    Hi all, I m running into a small but annoying problem that has me baffled. When I am editing a .php file and type /* and hit Return, the next line comes up
    Message 1 of 17 , Oct 13, 2008
      Hi all,
      I'm running into a small but annoying problem that has me baffled.
      When I am editing a .php file and type '/*' and hit Return, the next
      line comes up as ' * ' (notice the space on each side), which is the
      behavior I expect and want.

      However, I also want .inc and .html files to behave as PHP
      files. .inc files seem to get that behavior automatically, and I have
      'au BufRead,BufNewFile *.html set filetype=php' in my .vimrc file to
      force .html files to conform. When I am editing a .inc or .html file
      and type '/*' and hit Return, the next line comes up with an extra tab
      and no '*', which is not what I want.

      :set filetype confirms that filetype=php in all of these cases.

      I can't figure out what setting might be different in cases where I am
      editing one of the latter files, especially concerning .inc files
      where the filetype is assigned without my interference. Anyone have a
      guess?

      Thanks,
      Ian

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • fritzophrenic
      ... The comments option usually controls this I think. What is the output of :set comments? in each of these files?
      Message 2 of 17 , Oct 14, 2008
        On Oct 13, 5:39 pm, Ian Young <ian.greenl...@...> wrote:
        > Hi all,
        > I'm running into a small but annoying problem that has me baffled.
        > When I am editing a .php file and type '/*' and hit Return, the next
        > line comes up as ' * ' (notice the space on each side), which is the
        > behavior I expect and want.
        >
        > However, I also want .inc and .html files to behave as PHP
        > files.  .inc files seem to get that behavior automatically, and I have
        > 'au BufRead,BufNewFile *.html set filetype=php' in my .vimrc file to
        > force .html files to conform.  When I am editing a .inc or .html file
        > and type '/*' and hit Return, the next line comes up with an extra tab
        > and no '*', which is not what I want.
        >
        > :set filetype confirms that filetype=php in all of these cases.
        >
        > I can't figure out what setting might be different in cases where I am
        > editing one of the latter files, especially concerning .inc files
        > where the filetype is assigned without my interference.  Anyone have a
        > guess?
        >
        > Thanks,
        > Ian

        The "comments" option usually controls this I think. What is the
        output of ":set comments?" in each of these files?
        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Ian Young
        ... In a .inc file: comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n: ,fb:- In a .php file: comments=s1:/*,mb:*,ex:*/,://,:# I ve tried running set
        Message 3 of 17 , Oct 14, 2008
          fritzophrenic wrote:
          >
          >
          > On Oct 13, 5:39 pm, Ian Young <ian.greenl...@...> wrote:
          >> Hi all,
          >> I'm running into a small but annoying problem that has me baffled.
          >> When I am editing a .php file and type '/*' and hit Return, the next
          >> line comes up as ' * ' (notice the space on each side), which is the
          >> behavior I expect and want.
          >>
          >> However, I also want .inc and .html files to behave as PHP
          >> files. .inc files seem to get that behavior automatically, and I have
          >> 'au BufRead,BufNewFile *.html set filetype=php' in my .vimrc file to
          >> force .html files to conform. When I am editing a .inc or .html file
          >> and type '/*' and hit Return, the next line comes up with an extra tab
          >> and no '*', which is not what I want.
          >>
          >> :set filetype confirms that filetype=php in all of these cases.
          >>
          >> I can't figure out what setting might be different in cases where I am
          >> editing one of the latter files, especially concerning .inc files
          >> where the filetype is assigned without my interference. Anyone have a
          >> guess?
          >>
          >> Thanks,
          >> Ian
          >
          > The "comments" option usually controls this I think. What is the
          > output of ":set comments?" in each of these files?

          In a .inc file: comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
          In a .php file: comments=s1:/*,mb:*,ex:*/,://,:#

          I've tried running 'set comments=s1:/*,mb:*,ex:*/,://,:#' in the .inc
          file, and it didn't change the behavior I described.

          Ian

          --



          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Ian Young
          ... Good call! That was indeed the problem. PHP files have fo=qrowcb, while the others had fo=tcq (the default). I poked around and couldn t figure out the
          Message 4 of 17 , Oct 27, 2008
            On Sun, Oct 19, 2008 at 6:14 PM, Peter Hodge <toomuchphp-vim@...> wrote:
            >
            > Hello,
            >
            > What is the value of formatoptions in each of those filetypes?
            >
            > :setlocal fo?
            >
            > Specifically, you'll need to have at the letter 'r' in the value. (:help fo-table for more info)
            >
            > regards,
            > Peter
            >

            Good call! That was indeed the problem. PHP files have fo=qrowcb,
            while the others had fo=tcq (the default). I poked around and
            couldn't figure out the "correct" way of fixing this, but for the
            moment putting the following lines in my ~/.vimrc seems to have done
            the trick:

            au BufRead,BufNewFile *.html setlocal fo=qrowcb
            au BufRead,BufNewFile *.inc setlocal fo=qrowcb

            Thanks again,
            Ian

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Tony Mechelynck
            ... Well, you could create a ~/.vim/after/ftplugin/html.vim (on Unix) or ~/vimfiles/after/ftplugin/html.vim (on Windows), and similarly for whatever filetype
            Message 5 of 17 , Oct 27, 2008
              On 27/10/08 18:47, Ian Young wrote:
              > On Sun, Oct 19, 2008 at 6:14 PM, Peter Hodge<toomuchphp-vim@...> wrote:
              >> Hello,
              >>
              >> What is the value of formatoptions in each of those filetypes?
              >>
              >> :setlocal fo?
              >>
              >> Specifically, you'll need to have at the letter 'r' in the value. (:help fo-table for more info)
              >>
              >> regards,
              >> Peter
              >>
              >
              > Good call! That was indeed the problem. PHP files have fo=qrowcb,
              > while the others had fo=tcq (the default). I poked around and
              > couldn't figure out the "correct" way of fixing this, but for the
              > moment putting the following lines in my ~/.vimrc seems to have done
              > the trick:
              >
              > au BufRead,BufNewFile *.html setlocal fo=qrowcb
              > au BufRead,BufNewFile *.inc setlocal fo=qrowcb
              >
              > Thanks again,
              > Ian

              Well, you could create a ~/.vim/after/ftplugin/html.vim (on Unix) or
              ~/vimfiles/after/ftplugin/html.vim (on Windows), and similarly for
              whatever filetype the *.inc files are detected as having, with the
              single line:

              setlocal fo+=r

              Create the directories if they don't yet exist. You can do this from
              within Vim, using for instance, on Unix:

              :!mkdir -pv ~/.vim/after/ftplugin

              or, on Windows, this can give errors (which can be neglected) if the
              directories already exist:

              :!md $HOME/vimfiles
              :!md $HOME/vimfiles/after
              :!md $HOME/vimfiles/after/ftplugin

              This has the advantage (on Windows) that it uses whatever Vim sets $HOME
              to even if the HOME environment variable is unset outside of Vim.


              Best regards,
              Tony.
              --
              You need only reflect that one of the best ways to get yourself a
              reputation as a dangerous citizen these days is to go about repeating
              the very phrases which our founding fathers used in the struggle for
              independence.
              -- Charles A. Beard

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Ian Young
              On Mon, Oct 27, 2008 at 5:23 PM, Tony Mechelynck ... Thanks, but what I meant was that it doesn t seem like I should need a workaround at all. Somewhere vim
              Message 6 of 17 , Oct 28, 2008
                On Mon, Oct 27, 2008 at 5:23 PM, Tony Mechelynck
                <antoine.mechelynck@...> wrote:
                >
                > Well, you could create a ~/.vim/after/ftplugin/html.vim (on Unix) or
                > ~/vimfiles/after/ftplugin/html.vim (on Windows), and similarly for
                > whatever filetype the *.inc files are detected as having, with the
                > single line:
                >
                > setlocal fo+=r
                >
                > Create the directories if they don't yet exist. You can do this from
                > within Vim, using for instance, on Unix:
                >
                > :!mkdir -pv ~/.vim/after/ftplugin
                >
                > or, on Windows, this can give errors (which can be neglected) if the
                > directories already exist:
                >
                > :!md $HOME/vimfiles
                > :!md $HOME/vimfiles/after
                > :!md $HOME/vimfiles/after/ftplugin
                >
                > This has the advantage (on Windows) that it uses whatever Vim sets $HOME
                > to even if the HOME environment variable is unset outside of Vim.
                >
                >
                > Best regards,
                > Tony.

                Thanks, but what I meant was that it doesn't seem like I should need a
                workaround at all. Somewhere vim is applying custom formatoptions to
                php files. Since vim is smart enough to determine that a .inc file
                should have filetype=php if it starts with <?php, shouldn't it apply
                the custom formatoptions as well in those cases? To me, the current
                behavior seems unexpected. I'm happy to file a bug report if others
                agree.

                Ian

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Ben Schmidt
                ... Yes, Ian, you re right, it should be setting the formatoptions correctly simply by having the filetype set correctly. It isn t because of a bug in
                Message 7 of 17 , Oct 28, 2008
                  > Thanks, but what I meant was that it doesn't seem like I should need a
                  > workaround at all. Somewhere vim is applying custom formatoptions to
                  > php files. Since vim is smart enough to determine that a .inc file
                  > should have filetype=php if it starts with <?php, shouldn't it apply
                  > the custom formatoptions as well in those cases? To me, the current
                  > behavior seems unexpected. I'm happy to file a bug report if others
                  > agree.

                  Yes, Ian, you're right, it should be setting the formatoptions correctly
                  simply by having the filetype set correctly.

                  It isn't because of a bug in indent/php.vim.

                  The attached patch fixes it, and I'm CCing the maintainer so he can
                  incorporate this or a similar fix into the official version.

                  To explain the problem: the indent script was endeavouring to make sure
                  options got re-set (set again) when filetype was reinforced or a file
                  reloaded by defining an autocommand. However, the autocommand was based
                  on filename, not on filetype, so it didn't always work. Simply changing
                  it to be a strictly filetype-based autocommand doesn't work, as the
                  filetype autocommands have already fired when the script is loaded, so
                  it must also call ResetOptions directly. To allow for this, the function
                  must be defined before it is called, so things get moved around a bit.
                  In my patch I also took the liberty of renaming ResetOptions to
                  ResetPhpOptions to avoid name clashes in the global namespace, and fixed
                  an apparent typo in a variable name: rest->reset.

                  Can you please acknowledge you've got this, John?

                  Cheers,

                  Ben.




                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • John Wellesz
                  Thank you for the patch Ben, the only thing that troubles me is that with this change, ResetPhpOptions() is no longer called last. I don t remember why I had
                  Message 8 of 17 , Oct 29, 2008
                    Thank you for the patch Ben, the only thing that troubles me is that with this change, ResetPhpOptions() is no longer called last. I don't remember why I had to do that but I remember it was useful
                     The only thing I remember was that something else was setting the formatoptions wrongly for PHP files after php.vim was loaded (for some users at least) but maybe this is no longer required with Vim7...
                     
                    In fact your patch could be simplified by just calling ResetPhpOption() after its definition and before returning when 'b:did_indent' exists since the indent script is called on 'au filetype php' by indent.vim
                     
                    In the version 1.29 of the indent script I've "fixed" this issue by using the same detection scheme as filtype.vim:
                     
                        au BufWinEnter,Syntax *.php,*.php\d,*.phtml,*.ctp,*.inc call ResetOptions()
                    http://www.2072productions.com/vim/indent/php.vim (this version was released 3 days ago)
                     
                    Of course, it'll break if new file extensions are added to filetype.vim :/
                     
                    The real problem is that all of this has nothing to do in the indent script, it should be set in ftplugin/php.vim
                    (I CC the maintainer)
                     
                    John

                     
                    On Wed, Oct 29, 2008 at 12:59 AM, Ben Schmidt <mail_ben_schmidt@...> wrote:
                    Yes, Ian, you're right, it should be setting the formatoptions correctly
                    simply by having the filetype set correctly.

                    It isn't because of a bug in indent/php.vim.

                    The attached patch fixes it, and I'm CCing the maintainer so he can
                    incorporate this or a similar fix into the official version.

                    To explain the problem: the indent script was endeavouring to make sure
                    options got re-set (set again) when filetype was reinforced or a file
                    reloaded by defining an autocommand. However, the autocommand was based
                    on filename, not on filetype, so it didn't always work. Simply changing
                    it to be a strictly filetype-based autocommand doesn't work, as the
                    filetype autocommands have already fired when the script is loaded, so
                    it must also call ResetOptions directly. To allow for this, the function
                    must be defined before it is called, so things get moved around a bit.
                    In my patch I also took the liberty of renaming ResetOptions to
                    ResetPhpOptions to avoid name clashes in the global namespace, and fixed
                    an apparent typo in a variable name: rest->reset.

                    Can you please acknowledge you've got this, John?

                    Cheers,

                    Ben.

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---

                  • Ben Schmidt
                    ... Nothing else seems to be interfering for me. ... Well, that would simplify the script, but would be a more major change, so a more complicated patch, I
                    Message 9 of 17 , Oct 29, 2008
                      John Wellesz wrote:
                      > Thank you for the patch Ben, the only thing that troubles me is that
                      > with this change, ResetPhpOptions() is no longer called last. I don't
                      > remember why I had to do that but I remember it was useful
                      > The only thing I remember was that something else was setting the
                      > formatoptions wrongly for PHP files after php.vim was loaded (for some
                      > users at least) but maybe this is no longer required with Vim7...

                      Nothing else seems to be interfering for me.

                      > In fact your patch could be simplified by just calling ResetPhpOption()
                      > after its definition and before returning when 'b:did_indent' exists
                      > since the indent script is called on 'au filetype php' by indent.vim

                      Well, that would simplify the script, but would be a more major change,
                      so a more complicated patch, I think. To be honest, when I looked at the
                      script, I wondered why it wasn't done that way, because that seems the
                      obvious solution. Given that at the moment anyway, nothing seems to be
                      interfering with formatoptions after your indent script sets it, is this
                      worth a try?

                      > In the version 1.29 of the indent script I've "fixed" this issue by
                      > using the same detection scheme as filtype.vim:
                      >
                      > au BufWinEnter,Syntax *.php,*.php\d,*.phtml,*.ctp,*.inc call
                      > ResetOptions()
                      > http://www.2072productions.com/vim/indent/php.vim (this version was
                      > released 3 days ago)

                      That will break things. *.inc can be other file types, and if you edit
                      one of them after editing a plain .php file or such, which isn't all
                      that unlikely, your new autocommand will kick in when it shouldn't.

                      > Of course, it'll break if new file extensions are added to filetype.vim :/

                      Yes. A much bigger problem, though, is that it will break when users add
                      new extensions or patterns to their .vimrc, or issue :set ft=php on the
                      commandline (I personally do that a lot). Both those things really
                      should get the formatoptions set correctly but don't unless the filetype
                      autocommand alone can trigger the setting of formatoptions.

                      > The real problem is that all of this has nothing to do in the indent
                      > script, it should be set in ftplugin/php.vim
                      > (I CC the maintainer)

                      True. How about moving this stuff into there, Dan?

                      Ben.




                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_use" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • John Wellesz
                      ... Have you tried to edit mixed files? PHP files containing HTML and or javascript or other languages, I think it was mostly to prevent this kind of
                      Message 10 of 17 , Oct 29, 2008
                        Nothing else seems to be interfering for me.
                         
                        Have you tried to edit "mixed" files? PHP files containing HTML and or javascript or other languages, I think it was mostly to prevent this kind of interferences but I really don't remember...
                        In fact your patch could be simplified by just calling ResetPhpOption() after its definition and before returning when 'b:did_indent' exists since the indent script is called on 'au filetype php' by indent.vim

                        Well, that would simplify the script, but would be a more major change,
                        so a more complicated patch, I think. To be honest, when I looked at the
                        script, I wondered why it wasn't done that way, because that seems the
                        obvious solution. Given that at the moment anyway, nothing seems to be
                        interfering with formatoptions after your indent script sets it, is this
                        worth a try?
                         
                        The patch is simple, you just have to add two times the same line at different places:
                         
                        add   
                         
                        call ResetPhpOptions()
                         
                         right after the function is defined and replace
                         
                        if exists("*GetPhpIndent")
                            finish " XXX
                        endif

                        by
                         
                        if exists("*GetPhpIndent")
                            call ResetPhpOptions()
                            finish " XXX
                        endif
                         
                        (it was not right after 'if exists("b:did_indent")' like I said in my previous message)
                         
                        and finaly comment the line
                         
                        au BufWinEnter,Syntax *.php,*.php\d,*.phtml,*.ctp,*.inc call ResetPhpOptions()

                        In the version 1.29 of the indent script I've "fixed" this issue by using the same detection scheme as filtype.vim:
                             au BufWinEnter,Syntax *.php,*.php\d,*.phtml,*.ctp,*.inc call ResetOptions()
                        http://www.2072productions.com/vim/indent/php.vim (this version was released 3 days ago)

                        That will break things. *.inc can be other file types, and if you edit
                        one of them after editing a plain .php file or such, which isn't all
                        that unlikely, your new autocommand will kick in when it shouldn't.
                         
                         
                        No, I've added a check for &filetype=php in ResetPhpOptions()
                         

                        Of course, it'll break if new file extensions are added to filetype.vim :/

                        Yes. A much bigger problem, though, is that it will break when users add
                        new extensions or patterns to their .vimrc, or issue :set ft=php on the
                        commandline (I personally do that a lot). Both those things really
                        should get the formatoptions set correctly but don't unless the filetype
                        autocommand alone can trigger the setting of formatoptions.
                         
                        I've applyed the patch above to my version of the script, I'll see if something is interferring,
                         


                        The real problem is that all of this has nothing to do in the indent script, it should be set in ftplugin/php.vim
                        (I CC the maintainer)

                        True. How about moving this stuff into there, Dan?
                         
                        I remember something now about why I did put those format options in my script, it's clear that the 'comments' option should be set in the ftplugin but the formatoptions are more a user choice that should only be set in user pref files. I've set the formatoptions in my script because I know that if I don't, almost noone will set them ever... and most people will just not know this feature exists:/ (I stumble on it by accident myself...)
                         
                        John


                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_use" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---

                      • Ben Schmidt
                        ... Yep. Most of my files are mixed. ... You also have to move the whole function definition of ResetPhpOptions, or it s called before it s defined. I guess
                        Message 11 of 17 , Oct 30, 2008
                          > Have you tried to edit "mixed" files? PHP files containing HTML and or
                          > javascript or other languages, I think it was mostly to prevent this
                          > kind of interferences but I really don't remember...

                          Yep. Most of my files are 'mixed.'

                          > The patch is simple, you just have to add two times the same line at
                          > different places:
                          >
                          > add
                          >
                          > call ResetPhpOptions()
                          >
                          > right after the function is defined and replace
                          >
                          > if exists("*GetPhpIndent")
                          > finish " XXX
                          > endif
                          > by
                          >
                          > if exists("*GetPhpIndent")
                          > call ResetPhpOptions()
                          > finish " XXX
                          > endif
                          >
                          > (it was not right after 'if exists("b:did_indent")' like I said in my
                          > previous message)
                          >
                          > and finally comment the line
                          >
                          > au BufWinEnter,Syntax *.php,*.php\d,*.phtml,*.ctp,*.inc call
                          > ResetPhpOptions()

                          You also have to move the whole function definition of ResetPhpOptions,
                          or it's called before it's defined. I guess it's more a larger change
                          than a more complicated change, which is really what I meant.

                          > That will break things. *.inc can be other file types, and if you edit
                          > one of them after editing a plain .php file or such, which isn't all
                          > that unlikely, your new autocommand will kick in when it shouldn't.
                          >
                          > No, I've added a check for &filetype=php in ResetPhpOptions()

                          OK, cool.

                          > Of course, it'll break if new file extensions are added to
                          > filetype.vim :/
                          >
                          > Yes. A much bigger problem, though, is that it will break when users add
                          > new extensions or patterns to their .vimrc, or issue :set ft=php on the
                          > commandline (I personally do that a lot). Both those things really
                          > should get the formatoptions set correctly but don't unless the filetype
                          > autocommand alone can trigger the setting of formatoptions.
                          >
                          > I've applyed the patch above to my version of the script, I'll see if
                          > something is interfering,

                          Cool. If you post it or send it to me, I'm happy to install it and see
                          if I notice any ill effects, too.

                          > The real problem is that all of this has nothing to do in the
                          > indent script, it should be set in ftplugin/php.vim
                          > (I CC the maintainer)
                          >
                          > True. How about moving this stuff into there, Dan?
                          >
                          > I remember something now about why I did put those format options in my
                          > script, it's clear that the 'comments' option should be set in the
                          > ftplugin but the formatoptions are more a user choice that should only
                          > be set in user pref files. I've set the formatoptions in my script
                          > because I know that if I don't, almost noone will set them ever... and
                          > most people will just not know this feature exists:/ (I stumble on it by
                          > accident myself...)

                          You don't think? I personally use filetype plugins often but indent
                          rarely (I often reverse their effects with an after-script) and I think
                          a lot of people are similar.

                          I don't suppose it matters all that much, but my personal opinion is
                          that indent should really just be about indent, and formatting features
                          should be in the ftplugins.

                          Ben.




                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_use" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • John Wellesz
                          On Thu, Oct 30, 2008 at 10:52 AM, Ben Schmidt
                          Message 12 of 17 , Oct 30, 2008
                            On Thu, Oct 30, 2008 at 10:52 AM, Ben Schmidt <mail_ben_schmidt@...> wrote:
                            You also have to move the whole function definition of ResetPhpOptions,
                            or it's called before it's defined. I guess it's more a larger change
                            than a more complicated change, which is really what I meant.

                            no need to move ResetPhpOptions() around ; here is the new php.vim (version 1.30 BETA 1)

                             

                            You don't think? I personally use filetype plugins often but indent
                            rarely (I often reverse their effects with an after-script) and I think
                            a lot of people are similar.

                            Yep this is often because indent scripts are not accurate and you find yourself formating your code in a certain way just to make the ident script happy...
                            Hopefuly this is not the case with my indent script :)
                             

                            I don't suppose it matters all that much, but my personal opinion is
                            that indent should really just be about indent, and formatting features
                            should be in the ftplugins.

                            I agree with you but it's not always easy to contact and to convince the maintainer... (I had a lot of troubles with the previous author of the php indent script)
                             
                            John


                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_use" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---

                          • David Fishburn
                            ... Absolutely, that is what the ftplugin directory is for. ftplugin/sql.vim sets all the options for SQL (formatoptions and much more), it has nothing to do
                            Message 13 of 17 , Oct 30, 2008
                              >> I don't suppose it matters all that much, but my personal opinion is
                              >> that indent should really just be about indent, and formatting features
                              >> should be in the ftplugins.

                              Absolutely, that is what the ftplugin directory is for.

                              ftplugin/sql.vim sets all the options for SQL (formatoptions and much
                              more), it has nothing to do with indenting and vice-versa.

                              Dave

                              --~--~---------~--~----~------------~-------~--~----~
                              You received this message from the "vim_use" maillist.
                              For more information, visit http://www.vim.org/maillist.php
                              -~----------~----~----~----~------~----~------~--~---
                            • Ben Schmidt
                              ... O yes, of course you don t. I must be going crazy. I ll install the beta and see if I notice anything. Thanks for your work on this. ... Well, we ll wait
                              Message 14 of 17 , Oct 30, 2008
                                John Wellesz wrote:
                                > On Thu, Oct 30, 2008 at 10:52 AM, Ben Schmidt
                                > <mail_ben_schmidt@... <mailto:mail_ben_schmidt@...>>
                                > wrote:
                                >
                                > You also have to move the whole function definition of ResetPhpOptions,
                                > or it's called before it's defined. I guess it's more a larger change
                                > than a more complicated change, which is really what I meant.
                                >
                                > no need to move ResetPhpOptions() around ; here is the new php.vim
                                > (version 1.30 BETA 1)
                                >
                                > http://www.2072productions.com/vim/indent/beta/php.vim

                                O yes, of course you don't. I must be going crazy. I'll install the beta
                                and see if I notice anything.

                                Thanks for your work on this.

                                > I don't suppose it matters all that much, but my personal opinion is
                                > that indent should really just be about indent, and formatting features
                                > should be in the ftplugins.
                                >
                                > I agree with you but it's not always easy to contact and to convince the
                                > maintainer... (I had a lot of troubles with the previous author of the
                                > php indent script)

                                Well, we'll wait and see if Dan replies, and what he says!

                                Smiles,

                                Ben.





                                --~--~---------~--~----~------------~-------~--~----~
                                You received this message from the "vim_use" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                                -~----------~----~----~----~------~----~------~--~---
                              • Tony Mechelynck
                                On 30/10/08 19:09, John Wellesz wrote: [...] ... [...] My approach is just not to care what makes the indent script happy or unhappy: with :filetype indent
                                Message 15 of 17 , Oct 30, 2008
                                  On 30/10/08 19:09, John Wellesz wrote:
                                  [...]
                                  > Yep this is often because indent scripts are not accurate and you find
                                  > yourself formating your code in a certain way just to make the ident
                                  > script happy...
                                  > Hopefuly this is not the case with my indent script :)
                                  [...]

                                  My approach is just not to care what makes the indent script happy or
                                  unhappy: with ":filetype indent off" I indent my files (of any filetype)
                                  manually the way I damn well please.

                                  Best regards,
                                  Tony.
                                  --
                                  There are two sides to every divorce: yours and the shithead's.

                                  --~--~---------~--~----~------------~-------~--~----~
                                  You received this message from the "vim_use" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                  -~----------~----~----~----~------~----~------~--~---
                                • David Fishburn
                                  On Thu, Oct 30, 2008 at 4:45 PM, Tony Mechelynck ... That is of course your prerogative, but the indent scripts provide a very useful function. If they are
                                  Message 16 of 17 , Oct 31, 2008
                                    On Thu, Oct 30, 2008 at 4:45 PM, Tony Mechelynck
                                    <antoine.mechelynck@...> wrote:
                                    >
                                    > On 30/10/08 19:09, John Wellesz wrote:
                                    > [...]
                                    >> Yep this is often because indent scripts are not accurate and you find
                                    >> yourself formating your code in a certain way just to make the ident
                                    >> script happy...
                                    >> Hopefuly this is not the case with my indent script :)
                                    > [...]
                                    >
                                    > My approach is just not to care what makes the indent script happy or
                                    > unhappy: with ":filetype indent off" I indent my files (of any filetype)
                                    > manually the way I damn well please.

                                    That is of course your prerogative, but the indent scripts provide a
                                    very useful function. If they are not behaving correctly then
                                    hopefully the author of the indent script can make the corrections.

                                    I know we are all busy with our day to day work, but there should be
                                    some provision for adding changes made by other people when the
                                    documented maintainers are not responding. This I image would have to
                                    be maintained by some of the people on the vim_dev list which have
                                    more frequent communication with Bram. Inundating Bram with
                                    unqualified code changes without the history of maintainer absence
                                    would most likely not get too far.

                                    My 2 cents.
                                    Dave

                                    --~--~---------~--~----~------------~-------~--~----~
                                    You received this message from the "vim_use" maillist.
                                    For more information, visit http://www.vim.org/maillist.php
                                    -~----------~----~----~----~------~----~------~--~---
                                  • Tony Mechelynck
                                    ... Of course. The fact is: my indenting style is just too unruly for scripting. Oh, other people may shudder at the look of my HTML source but I like it the
                                    Message 17 of 17 , Oct 31, 2008
                                      On 31/10/08 18:00, David Fishburn wrote:
                                      > On Thu, Oct 30, 2008 at 4:45 PM, Tony Mechelynck
                                      > <antoine.mechelynck@...> wrote:
                                      >> On 30/10/08 19:09, John Wellesz wrote:
                                      >> [...]
                                      >>> Yep this is often because indent scripts are not accurate and you find
                                      >>> yourself formating your code in a certain way just to make the ident
                                      >>> script happy...
                                      >>> Hopefuly this is not the case with my indent script :)
                                      >> [...]
                                      >>
                                      >> My approach is just not to care what makes the indent script happy or
                                      >> unhappy: with ":filetype indent off" I indent my files (of any filetype)
                                      >> manually the way I damn well please.
                                      >
                                      > That is of course your prerogative, but the indent scripts provide a
                                      > very useful function. If they are not behaving correctly then
                                      > hopefully the author of the indent script can make the corrections.
                                      >
                                      > I know we are all busy with our day to day work, but there should be
                                      > some provision for adding changes made by other people when the
                                      > documented maintainers are not responding. This I image would have to
                                      > be maintained by some of the people on the vim_dev list which have
                                      > more frequent communication with Bram. Inundating Bram with
                                      > unqualified code changes without the history of maintainer absence
                                      > would most likely not get too far.
                                      >
                                      > My 2 cents.
                                      > Dave

                                      Of course.

                                      The fact is: my indenting style is just too unruly for scripting. Oh,
                                      other people may shudder at the look of my HTML source but I like it the
                                      way it is, and I'm the only one making changes in my own pages.

                                      For Vim scripts, ":set autoindent smartindent" is good enough for me.
                                      Even 'cindent' I don't use, but then I don't program in C anyway, and in
                                      CSS my coding style is, shall I say, "clear but unusual".


                                      Best regards,
                                      Tony.
                                      --
                                      "I have just read your lousy review buried in the back pages. You
                                      sound like a frustrated old man who never made a success, an
                                      eight-ulcer man on a four-ulcer job, and all four ulcers working. I
                                      have never met you, but if I do you'll need a new nose and plenty of
                                      beefsteak and perhaps a supporter below. Westbrook Pegler, a
                                      guttersnipe, is a gentleman compared to you. You can take that as more
                                      of an insult than as a reflection on your ancestry."
                                      -- President Harry S Truman

                                      --~--~---------~--~----~------------~-------~--~----~
                                      You received this message from the "vim_use" maillist.
                                      For more information, visit http://www.vim.org/maillist.php
                                      -~----------~----~----~----~------~----~------~--~---
                                    Your message has been successfully submitted and would be delivered to recipients shortly.