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

PHP Dict/Omni/Tag Completion?

Expand Messages
  • 703designs
    How could I map to provide a completion menu that included the PHP dictionary provided by Rasmus Lerdorf, tags grabbed from all files in a Project
    Message 1 of 5 , Aug 3, 2008
    • 0 Attachment
      How could I map <tab> to provide a completion menu that included the
      PHP dictionary provided by Rasmus Lerdorf, tags grabbed from all files
      in a Project directory (classes, interfaces, functions, methods), and
      omni-completion, if helpful? I'm trying to match the sort of auto-
      completion in Zend Studio and Eclipse PDT with Vim. I've had all three
      of the above working at different times (CTags for tags), but never
      together, and they always crowded other files because the completion
      wasn't restricted to the PHP filetype.
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Avinash Vora
      ... Hmm, I don t know if I d map it to tab, but here s some untested vimscript: ---start to turn on omnicompletion for php autocmd FileType php set
      Message 2 of 5 , Aug 3, 2008
      • 0 Attachment
        On Aug 4, 2008, at 12:49 AM, 703designs wrote:

        > How could I map <tab> to provide a completion menu that included the
        > PHP dictionary provided by Rasmus Lerdorf, tags grabbed from all files
        > in a Project directory (classes, interfaces, functions, methods), and
        > omni-completion, if helpful?

        Hmm, I don't know if I'd map it to tab, but here's some untested
        vimscript:

        "---start
        " to turn on omnicompletion for php
        autocmd FileType php set omnifunc=phpcomplete#CompletePHP
        " to map tab to omnicomplete
        imap <tab> <c-x><c-o>
        "---end

        I think that should work--if you're not familiar with vimscript,
        here's a breakdown. The first line is an automatically executed
        command given certain situations. Here, if the filetype is php, it
        automatically sets omnifunc to the PHP library. The next line maps
        <tab> ONLY in insert mode to what I remember the keypress for
        omnicompletion to be.

        Hope that works and/or is what you want.

        --
        Avi

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Thomas Koch
        ... Have a look at my blog and the one from Tobias Schlitt for many PHP related VIM tweaks: http://www.koch.ro/blog http://schlitt.info I plan to assemble a
        Message 3 of 5 , Aug 3, 2008
        • 0 Attachment
          Am Sonntag 03 August 2008 21:50:29 schrieb Avinash Vora:
          > On Aug 4, 2008, at 12:49 AM, 703designs wrote:
          > > How could I map <tab> to provide a completion menu that included the
          > > PHP dictionary provided by Rasmus Lerdorf, tags grabbed from all files
          > > in a Project directory (classes, interfaces, functions, methods), and
          > > omni-completion, if helpful?
          >
          > Hmm, I don't know if I'd map it to tab, but here's some untested
          > vimscript:
          >
          > "---start
          > " to turn on omnicompletion for php
          > autocmd FileType php set omnifunc=phpcomplete#CompletePHP
          > " to map tab to omnicomplete
          > imap <tab> <c-x><c-o>
          > "---end
          >
          > I think that should work--if you're not familiar with vimscript,
          > here's a breakdown. The first line is an automatically executed
          > command given certain situations. Here, if the filetype is php, it
          > automatically sets omnifunc to the PHP library. The next line maps
          > <tab> ONLY in insert mode to what I remember the keypress for
          > omnicompletion to be.
          >
          > Hope that works and/or is what you want.
          >
          > --
          > Avi

          Have a look at my blog and the one from Tobias Schlitt for many PHP
          related VIM tweaks:

          http://www.koch.ro/blog
          http://schlitt.info

          I plan to assemble a structured overview on how to set up VIM for PHP
          editing sometime after my next math exam in two weeks.

          Cheers,
          --
          Thomas Koch, Software Developer
          http://www.koch.ro

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • 703designs
          Well, I have a very nice PHP setup now. Auto-completion with inline documentation, SQL and HTML highlighting in PHP strings, and I ve added the PHPDoc script.
          Message 4 of 5 , Aug 6, 2008
          • 0 Attachment
            Well, I have a very nice PHP setup now. Auto-completion with inline
            documentation, SQL and HTML highlighting in PHP strings, and I've
            added the PHPDoc script. All I'm missing now is function, class, var,
            and method awareness with CTags, but I'm not going to attempt that
            until I figure out how to use the Project plugin, which may be never
            (I've tried a few times over the last couple months, even posted a
            topic about it at
            http://groups.google.com/group/vim_use/browse_thread/thread/649a405b1780e1ec/2a5d1ca315e9a54a?lnk=gst&q=project#2a5d1ca315e9a54a
            ).

            Thanks for the help! Didn't expect it to be so simple.

            On Aug 3, 4:53 pm, Thomas Koch <tho...@...> wrote:
            > Am Sonntag 03 August 2008 21:50:29 schrieb Avinash Vora:
            >
            >
            >
            > > On Aug 4, 2008, at 12:49 AM, 703designs wrote:
            > > > How could I map <tab> to provide a completion menu that included the
            > > > PHP dictionary provided by Rasmus Lerdorf, tags grabbed from all files
            > > > in a Project directory (classes, interfaces, functions, methods), and
            > > > omni-completion, if helpful?
            >
            > > Hmm, I don't know if I'd map it to tab, but here's some untested
            > > vimscript:
            >
            > > "---start
            > > " to turn on omnicompletion for php
            > > autocmd FileType php set omnifunc=phpcomplete#CompletePHP
            > > " to map tab to omnicomplete
            > > imap <tab> <c-x><c-o>
            > > "---end
            >
            > > I think that should work--if you're not familiar with vimscript,
            > > here's a breakdown.  The first line is an automatically executed
            > > command given certain situations.  Here, if the filetype is php, it
            > > automatically sets omnifunc to the PHP library.  The next line maps
            > > <tab> ONLY in insert mode to what I remember the keypress for
            > > omnicompletion to be.
            >
            > > Hope that works and/or is what you want.
            >
            > > --
            > > Avi
            >
            > Have a look at my blog and the one from Tobias Schlitt for many PHP
            > related VIM tweaks:
            >
            > http://www.koch.ro/bloghttp://schlitt.info
            >
            > I plan to assemble a structured overview on how to set up VIM for PHP
            > editing sometime after my next math exam in two weeks.
            >
            > Cheers,
            > --
            > Thomas Koch, Software Developerhttp://www.koch.ro
            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Brad Waite
            Hey there, Would you mind detailing how you got to this point? I think I ve been looking in too many places and am just plain flummoxed at this point. Any
            Message 5 of 5 , Aug 31, 2008
            • 0 Attachment
              Hey there,

              Would you mind detailing how you got to this point? I think I've been
              looking in too many places and am just plain flummoxed at this point.

              Any pointers are appreciated.

              -BW

              On Aug 6, 9:32 am, 703designs <thomasmal...@...> wrote:
              > Well, I have a very nice PHP setup now. Auto-completion with inline
              > documentation, SQL and HTML highlighting in PHP strings, and I've
              > added the PHPDoc script. All I'm missing now is function, class, var,
              > and method awareness with CTags, but I'm not going to attempt that
              > until I figure out how to use the Project plugin, which may be never
              > (I've tried a few times over the last couple months, even posted a
              > topic about it athttp://groups.google.com/group/vim_use/browse_thread/thread/649a405b1...
              > ).
              >
              > Thanks for the help! Didn't expect it to be so simple.
              >
              > On Aug 3, 4:53 pm, Thomas Koch <tho...@...> wrote:
              >
              > > Am Sonntag 03 August 2008 21:50:29 schrieb Avinash Vora:
              >
              > > > On Aug 4, 2008, at 12:49 AM, 703designs wrote:
              > > > > How could I map <tab> to provide a completion menu that included the
              > > > > PHP dictionary provided by Rasmus Lerdorf, tags grabbed from all files
              > > > > in a Project directory (classes, interfaces, functions, methods), and
              > > > > omni-completion, if helpful?
              >
              > > > Hmm, I don't know if I'd map it to tab, but here's some untested
              > > > vimscript:
              >
              > > > "---start
              > > > " to turn on omnicompletion for php
              > > > autocmd FileType php set omnifunc=phpcomplete#CompletePHP
              > > > " to map tab to omnicomplete
              > > > imap <tab> <c-x><c-o>
              > > > "---end
              >
              > > > I think that should work--if you're not familiar with vimscript,
              > > > here's a breakdown. The first line is an automatically executed
              > > > command given certain situations. Here, if the filetype is php, it
              > > > automatically sets omnifunc to the PHP library. The next line maps
              > > > <tab> ONLY in insert mode to what I remember the keypress for
              > > > omnicompletion to be.
              >
              > > > Hope that works and/or is what you want.
              >
              > > > --
              > > > Avi
              >
              > > Have a look at my blog and the one from Tobias Schlitt for many PHP
              > > related VIM tweaks:
              >
              > >http://www.koch.ro/bloghttp://schlitt.info
              >
              > > I plan to assemble a structured overview on how to set up VIM for PHP
              > > editing sometime after my next math exam in two weeks.
              >
              > > Cheers,
              > > --
              > > Thomas Koch, Software Developerhttp://www.koch.ro

              --~--~---------~--~----~------------~-------~--~----~
              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.