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

Please tell me how to do use cscope or ctag with php

Expand Messages
  • SamPeng
    Hi, my cscope and ctag don t working with php. use C-] don t jump any function or var.Have one error:don t have this tags. ctag -R and cscope -R I test this
    Message 1 of 6 , May 1, 2009
    View Source
    • 0 Attachment
      Hi,
         my cscope and ctag don't working with php.
         use C-] don't jump any function or var.Have one error:don't have this tags.
        ctag -R and cscope -R I test this cmd.not have any help.
        Thanks your help!

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

    • David Fishburn
      ... What OS are you running this on? I usually do the following: cd /root/dir/where/php/is dir /s/b *.php cscope.files (Windows) find -name *.php
      Message 2 of 6 , May 1, 2009
      View Source
      • 0 Attachment
        On Fri, May 1, 2009 at 3:37 AM, SamPeng <sampeng87@...> wrote:
        >    my cscope and ctag don't working with php.
        >    use C-] don't jump any function or var.Have one error:don't have this
        > tags.
        >   ctag -R and cscope -R I test this cmd.not have any help.

        What OS are you running this on?

        I usually do the following:
        cd /root/dir/where/php/is

        dir /s/b *.php > cscope.files (Windows)
        find -name *.php > cscope.files (Unix)

        cscope -b (create the cscope database)

        In Vim:
        :cd /root/dir/where/php/is
        :cs add cscope.out . -C
        " I use the -C for case insensitivity

        Then I primarily use these 2 mappings:
        nnoremap g<C-\> :silent! cs find 0
        <C-R>=expand("<cword>")<CR><CR>:cwindow<CR>
        vnoremap <silent> g<c-\> :<C-U>
        \:let old_reg=getreg('"')<bar>
        \:let old_regmode=getregtype('"')<cr>
        \gvy
        \:silent! cs find s <C-R>=@"<cr><cr>
        \:call setreg('"', old_reg, old_regmode)<cr>:cwindow<CR>

        Notice this is using the cs find command, since cscope doesn't
        understand PHP, it can be used to find the methods and what not
        though. I do the same for SQL files and Perl.

        You can map the above to anything you want, it is hard to find key
        combinations which are not already useful though!

        HTH,
        Dave

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • SamPeng
        Oh~! Thank you this detail help.they are many helpful for me. yes.I solve this question..I to google this quesstion has 2 days.Thank you help me saving many
        Message 3 of 6 , May 1, 2009
        View Source
        • 0 Attachment
          Oh~!
          Thank you this detail help.they are many helpful for me.
          yes.I solve this question..I to google this quesstion has 2 days.Thank you help me saving many time to programe

          2009/5/1 David Fishburn <dfishburn.vim@...>

          On Fri, May 1, 2009 at 3:37 AM, SamPeng <sampeng87@...> wrote:
          >    my cscope and ctag don't working with php.
          >    use C-] don't jump any function or var.Have one error:don't have this
          > tags.
          >   ctag -R and cscope -R I test this cmd.not have any help.

          What OS are you running this on?

          I usually do the following:
             cd /root/dir/where/php/is

             dir /s/b *.php  > cscope.files    (Windows)
             find -name *.php > cscope.files   (Unix)

             cscope -b (create the cscope database)

          In Vim:
             :cd /root/dir/where/php/is
             :cs add cscope.out . -C
             " I use the -C for case insensitivity

          Then I primarily use these 2 mappings:
             nnoremap g<C-\> :silent! cs find 0
          <C-R>=expand("<cword>")<CR><CR>:cwindow<CR>
             vnoremap <silent> g<c-\> :<C-U>
                           \:let old_reg=getreg('"')<bar>
                           \:let old_regmode=getregtype('"')<cr>
                           \gvy
                           \:silent! cs find s <C-R>=@"<cr><cr>
                           \:call setreg('"', old_reg, old_regmode)<cr>:cwindow<CR>

          Notice this is using the cs find command, since cscope doesn't
          understand PHP, it can be used to find the methods and what not
          though.  I do the same for SQL files and Perl.

          You can map the above to anything you want, it is hard to find key
          combinations which are not already useful though!

          HTH,
          Dave




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

        • Nicolas Sebrecht
          ... Shouldn t be find -name *.php cscope.files ? % tree . ... `-- z `-- b.c % find -name *.c ./b.c ./z/b.c % find -name *.c ./b.c ./z/b.c ./y/r.c % --
          Message 4 of 6 , May 1, 2009
          View Source
          • 0 Attachment
            On Fri, May 01, 2009 at 08:25:18AM -0400, David Fishburn wrote:

            > find -name *.php > cscope.files (Unix)

            Shouldn't be
            find -name '*.php' > cscope.files
            ?

            % tree
            .
            |-- b.c
            |-- y
            | `-- r.c
            `-- z
            `-- b.c
            % find -name *.c
            ./b.c
            ./z/b.c
            % find -name '*.c'
            ./b.c
            ./z/b.c
            ./y/r.c
            %

            --
            Nicolas Sebrecht

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Nicolas Sebrecht
            ... Shouldn t be find -name *.php cscope.files ? % tree . ... `-- z `-- b.c % find -name *.c ./b.c ./z/b.c % find -name *.c ./b.c ./z/b.c ./y/r.c % --
            Message 5 of 6 , May 1, 2009
            View Source
            • 0 Attachment
              On Fri, May 01, 2009 at 08:25:18AM -0400, David Fishburn wrote:

              > find -name *.php > cscope.files (Unix)

              Shouldn't be
              find -name '*.php' > cscope.files
              ?

              % tree
              .
              |-- b.c
              |-- y
              | `-- r.c
              `-- z
              `-- b.c
              % find -name *.c
              ./b.c
              ./z/b.c
              % find -name '*.c'
              ./b.c
              ./z/b.c
              ./y/r.c
              %

              --
              Nicolas Sebrecht

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Tony Mechelynck
              ... [...] This may come as a surprise to you, but on the topic of Vim, and topics related to it, Google is rarely the best place to find help. The places to
              Message 6 of 6 , May 3, 2009
              View Source
              • 0 Attachment
                On 01/05/09 22:33, SamPeng wrote:
                > Oh~!
                > Thank you this detail help.they are many helpful for me.
                > yes.I solve this question..I to google this quesstion has 2 days.Thank
                > you help me saving many time to programe
                [...]

                This may come as a surprise to you, but on the topic of Vim, and topics
                related to it, Google is rarely the best place to find help.

                The places to find Vim help are:
                - Vim's own help system (using the :help command, possibly with help tag
                completion, and the :helpgrep command)
                see:
                :help
                :help :help
                :help {subject}
                :help 'wildmenu'
                :help 'wildmode'
                :help :helpgrep

                - The Vim Tips Wiki http://vim.wikia.com/

                - This mailing list / Google group.

                I'm listing them in the order in which I recommend checking them. This
                ML may have more answers than the other two together, but unlike them,
                it depends on the constant goodwill of flesh-and-bones people, while the
                other two are their accumulated knowledge and require only minimal updating.


                Best regards,
                Tony.
                --
                If you took all the students that fell asleep in class and laid them
                end to end, they'd be a lot more comfortable.
                -- "Graffiti in the Big Ten"

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