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

contextual gf

Expand Messages
  • horos
    hey, I was wondering what the best way to implement something like #include ^ cursor here hit gf load up /usr/include/stdio.h would be... Any
    Message 1 of 7 , Feb 27, 2001
    • 0 Attachment
      hey,

      I was wondering what the best way to implement something like

      #include <stdio.h>
      ^
      cursor here

      hit gf

      load up '/usr/include/stdio.h'

      would be... Any suggestions? (or is it already implemented?)

      Ed
    • horos
      ... oops. seems to do this already. does this tie into makefiles? ie - how does this handle things like : #include myfile.h Ed
      Message 2 of 7 , Feb 27, 2001
      • 0 Attachment
        >
        > hey,
        >
        > I was wondering what the best way to implement something like
        >
        > #include <stdio.h>
        > ^
        > cursor here
        >
        > hit gf
        >
        > load up '/usr/include/stdio.h'
        >
        > would be... Any suggestions? (or is it already implemented?)
        >
        > Ed
        >

        oops. seems to do this already. does this tie into makefiles? ie - how does this
        handle things like :

        #include "myfile.h"

        Ed
      • Alexey Marinichev
        ... path option gives you ...a list of directories which will be searched when using the gf, [f, ]f, ^Wf and other commands, provided that the file being
        Message 3 of 7 , Feb 27, 2001
        • 0 Attachment
          On Tue, Feb 27, 2001 at 10:23:35PM -0800, horos wrote:
          > >
          > > hey,
          > >
          > > I was wondering what the best way to implement something like
          > >
          > > #include <stdio.h>
          > > ^
          > > cursor here
          > >
          > > hit gf
          > >
          > > load up '/usr/include/stdio.h'
          > >
          > > would be... Any suggestions? (or is it already implemented?)
          > >
          > > Ed
          > >
          >
          > oops. seems to do this already. does this tie into makefiles? ie - how does this
          > handle things like :
          >
          > #include "myfile.h"
          >
          > Ed

          'path' option gives you "...a list of directories which will be searched
          when using the gf, [f, ]f, ^Wf and other commands, provided that the
          file being searched for has a relative path (not starting with '/')".

          --Lyosha
        • horos
          ... well, that s a start, but I was looking for something a little more sophisticated. When you say, in perl: use FileHandle; perl looks through a variable
          Message 4 of 7 , Feb 28, 2001
          • 0 Attachment
            >
            > 'path' option gives you "...a list of directories which will be searched
            > when using the gf, [f, ]f, ^Wf and other commands, provided that the
            > file being searched for has a relative path (not starting with '/')".
            >
            > --Lyosha

            well, that's a start, but I was looking for something a little more
            sophisticated. When you say, in perl:

            use FileHandle;

            perl looks through a variable called @INC to locate the module, and then tags
            '.pm' on the end of it. Hence, I'd want to be able to *program* the *f commands,
            and furthermore tie them to a given suffix (.pm, .pl, etc)

            Ed

            (
            ps -- this is also true for python and java, which do similar transforms...
            doing it really right would involve being able to handle 'import package.*'
            and split on multiple files.
            )

            (
            pps -- for some reason, my posts aren't making it to the list from my other
            address (edwardp@...). Could someone check to see what's going on/
            if I am being accidentally dropped?

            thanks much..
            )
          • Bram Moolenaar
            ... The suffixesadd option helps a bit here. But the file name must be valid for this to work, not end in * or have . for file name separator. ... This
            Message 5 of 7 , Mar 1, 2001
            • 0 Attachment
              horos wrote:

              > well, that's a start, but I was looking for something a little more
              > sophisticated. When you say, in perl:
              >
              > use FileHandle;
              >
              > perl looks through a variable called @INC to locate the module, and then
              > tags '.pm' on the end of it. Hence, I'd want to be able to *program* the *f
              > commands, and furthermore tie them to a given suffix (.pm, .pl, etc)

              The 'suffixesadd' option helps a bit here. But the file name must be valid
              for this to work, not end in "*" or have "." for file name separator.

              > ps -- this is also true for python and java, which do similar transforms...
              > doing it really right would involve being able to handle 'import package.*'
              > and split on multiple files.

              This works for the commands that look for an included file with 'includeexpr'.
              Using 'includeexpr' also for "gf" (when it doesn't work without modification)
              would be a solution.

              > pps -- for some reason, my posts aren't making it to the list from my other
              > address (edwardp@...). Could someone check to see what's going on/
              > if I am being accidentally dropped?

              You can only send messages to the list from the address where you subscribed.
              Unfortunately you don't get a warning now. I have asked the maillist
              maintainer to make it send a reply to you to let you know the message was
              refused, but apparently this still doesn't work.

              You could subscribe from the other address too, and then disable receiving
              messages there (Send a message to the vim-dev-help@... address to find out
              how).

              --
              hundred-and-one symptoms of being an internet addict:
              28. You have comandeered your teenager's phone line for the net and even his
              friends know not to call on his line anymore.

              /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
              ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
              \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
            • horos
              ... Or :: , for perl. ... hmm. I didn t see anything about includeexpr in the docs. Or for that matter suffixesadd. Were they things that were added post-5.7?
              Message 6 of 7 , Mar 1, 2001
              • 0 Attachment
                > > perl looks through a variable called @INC to locate the module, and then
                > > tags '.pm' on the end of it. Hence, I'd want to be able to *program* the *f
                > > commands, and furthermore tie them to a given suffix (.pm, .pl, etc)
                >
                > The 'suffixesadd' option helps a bit here. But the file name must be valid
                > for this to work, not end in "*" or have "." for file name separator.

                Or '::', for perl.

                > > ps -- this is also true for python and java, which do similar transforms...
                > > doing it really right would involve being able to handle 'import package.*'
                > > and split on multiple files.
                >
                > This works for the commands that look for an included file with 'includeexpr'.
                > Using 'includeexpr' also for 'gf' (when it doesn't work without modification)
                > would be a solution.

                hmm. I didn't see anything about includeexpr in the docs. Or for that matter
                suffixesadd. Were they things that were added post-5.7? Maybe an example
                might help, too.

                > > pps -- for some reason, my posts aren't making it to the list from my other
                > > address (edwardp@...). Could someone check to see what's going on/
                > > if I am being accidentally dropped?
                >
                > You can only send messages to the list from the address where you subscribed.
                > Unfortunately you don't get a warning now. I have asked the maillist
                > maintainer to make it send a reply to you to let you know the message was
                > refused, but apparently this still doesn't work.

                well, the thing is, I *am* subscribed in both places. And I get mail in both
                places. But the only messages that get through are from this address.

                Ed
              • Bram Moolenaar
                ... includeexpr is new in Vim 6.0. It s still in alpha testing though. ... Hmm, if the mail arrives it should work. Perhaps the address in the From line
                Message 7 of 7 , Mar 1, 2001
                • 0 Attachment
                  horos wrote:

                  > > This works for the commands that look for an included file with
                  > > 'includeexpr'. Using 'includeexpr' also for 'gf' (when it doesn't work
                  > > without modification) would be a solution.
                  >
                  > hmm. I didn't see anything about includeexpr in the docs. Or for that matter
                  > suffixesadd. Were they things that were added post-5.7? Maybe an example
                  > might help, too.

                  'includeexpr' is new in Vim 6.0. It's still in alpha testing though.

                  > > > pps -- for some reason, my posts aren't making it to the list from my
                  > > > other address (edwardp@...). Could someone check to see
                  > > > what's going on/ if I am being accidentally dropped?
                  > >
                  > > You can only send messages to the list from the address where you
                  > > subscribed. Unfortunately you don't get a warning now. I have asked the
                  > > maillist maintainer to make it send a reply to you to let you know the
                  > > message was refused, but apparently this still doesn't work.
                  >
                  > well, the thing is, I *am* subscribed in both places. And I get mail in both
                  > places. But the only messages that get through are from this address.

                  Hmm, if the mail arrives it should work. Perhaps the address in the "From"
                  line or the "Return-path" is different? You could try unsubscribing and
                  re-subscribing again. Otherwise send a message to vim-dev-help@... to
                  find out more.

                  --
                  Bumper sticker: Honk if you love peace and quiet.

                  /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                  ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                  \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                Your message has been successfully submitted and would be delivered to recipients shortly.