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

Drupal .module proper support (fwd)

Expand Messages
  • Alexis Wilke
    Hi guys,I m developing on Drupal now a days and find it annoying that gvim cannot detect that the .module are PHP files. So I added a few lines of code to
    Message 1 of 6 , Oct 9, 2008
    • 0 Attachment
      Hi guys,

      I'm developing on Drupal now a days and find it annoying that gvim cannot
      detect that the .module are PHP files. So I added a few lines of code to
      my filetype.vim to paliate. I would imagine some other vi lovers will run
      in this one too. We could also support the .install files I guess. Also
      that I do not have much of a problem with.

      Thank you.
      Alexis Wilke
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... Don t ever modify anything under $VIMRUNTIME, including $VIMRUNTIME/filetype.vim, because any update may (and sooner or later will) silently undo your
      Message 2 of 6 , Oct 9, 2008
      • 0 Attachment
        On 10/10/08 03:46, Alexis Wilke wrote:
        > Hi guys,
        >
        > I'm developing on Drupal now a days and find it annoying that gvim cannot
        > detect that the .module are PHP files. So I added a few lines of code to
        > my filetype.vim to paliate. I would imagine some other vi lovers will run
        > in this one too. We could also support the .install files I guess. Also
        > that I do not have much of a problem with.
        >
        > Thank you.
        > Alexis Wilke

        Don't ever modify anything under $VIMRUNTIME, including
        $VIMRUNTIME/filetype.vim, because any update may (and sooner or later
        will) silently undo your changes. This may happen next week, or it may
        happen next year, and in the latter case you will probably have
        forgotten by then which changes you made in the distribution.

        The right place for those changes is in $VIM/vimfiles/filetype.vim if
        you want them to apply to all users on your system, or in
        $HOME/.vim/fileype.vim (on Unix) or $HOME/vimfiles/filetype.vim (on
        Windows) if you want them to be used only by yourself.

        This is how you would set up this file (asssuming it doesn't exist yet):

        augroup filetypedetect
        au BufNewFile,BufRead *.hw,*.module,*.pkg
        \ if getline(1) =~ '<\?php' |
        \ setf php |
        \ endif
        augroup END

        And if the desired directories don't exist yet, well, create them. If
        you don't know where $HOME and $VIM are, use

        :echo $VIM
        :echo $HOME

        inside Vim.


        Best regards,
        Tony.
        --
        Paradise is exactly like where you are right now ... only much, much
        better.
        -- Laurie Anderson

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... The only person who should modify the official $VIMRUNTIME/filetype.vim is Bram, who is in charge of maintaining it. If you want to add a new filetype, or
        Message 3 of 6 , Oct 9, 2008
        • 0 Attachment
          On 10/10/08 06:18, Alexis Wilke wrote:
          > Tony,
          >
          > I don't understand what you're talking about.
          >
          > Are you saying that you do not want to ever modify the filetype.vim if
          > someone sends you a patch?
          >
          > Thank you.
          > Alexis

          The only person who should modify the official $VIMRUNTIME/filetype.vim
          is Bram, who is in charge of maintaining it.

          If you want to add a new filetype, or to modify how filetypes are
          detected, _don't_ modify $VIMRUNTIME/filetype.vim because, as I said,
          sooner or later your changes will be silently undone (any patch /may/ do
          it, and upgrading to the next version /will/ do it). What you should do
          is add your changes to $VIM/vimfiles/filetype.vim (all OSes,
          system-wide), $HOME/vimfiles/filetype.vim (Windows, single-user) or
          $HOME/.vim/filetype.vim (Unix, Mac, etc., single-user). These files are
          not touched by updates to Vim.

          Best regards,
          Tony.
          --
          You are only young once, but you can stay immature indefinitely.

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Alexis Wilke
          Tony, So... Is Bram reading the vim-dev? Or is that not the right place to post a patch? Thank you. Alexis ... Alexis Wilke President Made to Order Software
          Message 4 of 6 , Oct 9, 2008
          • 0 Attachment
            Tony,

            So... Is Bram reading the vim-dev? Or is that not the right place to post
            a patch?

            Thank you.
            Alexis


            On Fri, 10 Oct 2008, Tony Mechelynck wrote:

            > On 10/10/08 06:18, Alexis Wilke wrote:
            >> Tony,
            >>
            >> I don't understand what you're talking about.
            >>
            >> Are you saying that you do not want to ever modify the filetype.vim if
            >> someone sends you a patch?
            >>
            >> Thank you.
            >> Alexis
            >
            > The only person who should modify the official $VIMRUNTIME/filetype.vim is
            > Bram, who is in charge of maintaining it.
            >
            > If you want to add a new filetype, or to modify how filetypes are detected,
            > _don't_ modify $VIMRUNTIME/filetype.vim because, as I said, sooner or later
            > your changes will be silently undone (any patch /may/ do it, and upgrading to
            > the next version /will/ do it). What you should do is add your changes to
            > $VIM/vimfiles/filetype.vim (all OSes, system-wide),
            > $HOME/vimfiles/filetype.vim (Windows, single-user) or $HOME/.vim/filetype.vim
            > (Unix, Mac, etc., single-user). These files are not touched by updates to
            > Vim.
            >
            > Best regards,
            > Tony.
            > --
            > You are only young once, but you can stay immature indefinitely.
            >


            ------------
            Alexis Wilke
            President
            Made to Order Software Corporation

            e-mail: alexis@...
            cell-text: alexis.cell@... (please, only small messages)

            Web Pages: http://www.m2osw.com Corporation Site
            http://www.ordermade.ws Order Made!(r)
            http://www.turnwatcher.com Turn Watcher(tm)
            Company e-mail: contact@...
            Phone: +(1) 916 220 6482
            Fax: +(1) 916 988 1450

            Address: 9275 Blue Oak Drive
            Orangevale, California 95662
            United States of America

            CONFIDENTIAL

            This document contains non-public proprietary information
            that is subject to restrictions on use and/or disclosure.

            If you are not the intended recipient, any dissemination,
            distribution or copying is strictly prohibited. If you
            think that you have received this e-mail message in error,
            please e-mail the sender and delete all copies. Thank you.


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Tony Mechelynck
            ... Yes, Bram is reading the vim-dev list, but he is on holiday at present. When he comes back, he will see your patch, and he may accept it, reject it, or
            Message 5 of 6 , Oct 9, 2008
            • 0 Attachment
              On 10/10/08 07:06, Alexis Wilke wrote:
              > Tony,
              >
              > So... Is Bram reading the vim-dev? Or is that not the right place to
              > post a patch?
              >
              > Thank you.
              > Alexis

              Yes, Bram is reading the vim-dev list, but he is on holiday at present.
              When he comes back, he will see your patch, and he may accept it, reject
              it, or leave it to bake for some time before making a decision.

              In the meantime, don't modify your IMRUNTIME/filetype.vim because sooner
              or later the rug will be swept from under your feet.

              Best regards,
              Tony.
              --
              God gives us relatives; thank goodness we can chose our friends.

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Bram Moolenaar
              ... Makes sense. You use this statement: if getline(1) =~
              Message 6 of 6 , Nov 1, 2008
              • 0 Attachment
                Alexis Wilke wrote:

                > I'm developing on Drupal now a days and find it annoying that gvim cannot
                > detect that the .module are PHP files. So I added a few lines of code to
                > my filetype.vim to paliate. I would imagine some other vi lovers will run
                > in this one too. We could also support the .install files I guess. Also
                > that I do not have much of a problem with.

                Makes sense.

                You use this statement:

                if getline(1) =~ '<\?php'

                That backslash should probably not be there, since this matches "php" by
                itself. This might work better:

                if getline(1) =~ '<?php'

                --
                hundred-and-one symptoms of being an internet addict:
                163. You go outside for the fresh air (at -30 degrees) but open the
                window first to hear new mail arrive.

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                \\\ download, build and distribute -- http://www.A-A-P.org ///
                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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