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

Searching for macros defined in makefile

Expand Messages
  • Jean-Rene David
    Hello, I usually pass a lot of -DMACRO options to my compiler to control various build options for my project. These are defined in my makefile. I m looking
    Message 1 of 4 , Jun 27, 2008
    • 0 Attachment
      Hello,

      I usually pass a lot of "-DMACRO" options to my
      compiler to control various build options for my
      project. These are defined in my makefile. I'm
      looking for a way to make the i_CTRL-X_CTRL-D
      completion command find those macros.

      One solution I thought of was to generate a "fake"
      include file which would #define all the macros in
      the build. That can be done easily enough with a
      make target.

      What I would now like is for the i_CTRL-X_CTRL-D
      command to look in that generated file *without*
      having to actually include it in every single
      source file in my project.

      Is there any way to do that?

      --
      JR

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Gary Johnson
      ... How about using i_CTRL-N or i_CTRL-P and set the complete option accordingly? You could leave complete set to the defaults and just load your makefile
      Message 2 of 4 , Jun 27, 2008
      • 0 Attachment
        On 2008-06-27, Jean-Rene David <jrdavid@...> wrote:
        > Hello,
        >
        > I usually pass a lot of "-DMACRO" options to my
        > compiler to control various build options for my
        > project. These are defined in my makefile. I'm
        > looking for a way to make the i_CTRL-X_CTRL-D
        > completion command find those macros.
        >
        > One solution I thought of was to generate a "fake"
        > include file which would #define all the macros in
        > the build. That can be done easily enough with a
        > make target.
        >
        > What I would now like is for the i_CTRL-X_CTRL-D
        > command to look in that generated file *without*
        > having to actually include it in every single
        > source file in my project.
        >
        > Is there any way to do that?

        How about using i_CTRL-N or i_CTRL-P and set the 'complete' option
        accordingly? You could leave 'complete' set to the defaults and
        just load your makefile into another buffer, or you could add the
        'k' or 's' flags and set your makefile to be a dictionary or
        thesaurus file. See

        :help i_CTRL-N
        :help i_CTRL-P
        :help 'complete'

        HTH,
        Gary


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Jean-Rene David
        ... Of course. I hadn t thought of that. How blatantly simple. After posting my question I realized I hadn t mentioned the [D family of commands. It would be
        Message 3 of 4 , Jun 27, 2008
        • 0 Attachment
          * Gary Johnson [2008.06.27 13:10]:
          >
          > On 2008-06-27, Jean-Rene David <jrdavid@...> wrote:
          > > What I would now like is for the i_CTRL-X_CTRL-D
          > > command to look in that generated file *without*
          > > having to actually include it in every single
          > > source file in my project.
          > >
          > > Is there any way to do that?
          >
          > How about using i_CTRL-N or i_CTRL-P and set the 'complete' option
          > accordingly?

          Of course. I hadn't thought of that. How blatantly
          simple.

          After posting my question I realized I hadn't
          mentioned the "[D" family of commands. It would be
          nice for them to find my macro definitions too.

          Is there an easy way to do that too?

          --
          JR

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Gary Johnson
          ... Not that I can think of. I m not all that familiar with those commands, though. All I could think of was a mapping to a grep of that makefile. Regards,
          Message 4 of 4 , Jun 27, 2008
          • 0 Attachment
            On 2008-06-27, Jean-Rene David <jrdavid@...> wrote:
            > * Gary Johnson [2008.06.27 13:10]:
            > >
            > > On 2008-06-27, Jean-Rene David <jrdavid@...> wrote:
            > > > What I would now like is for the i_CTRL-X_CTRL-D
            > > > command to look in that generated file *without*
            > > > having to actually include it in every single
            > > > source file in my project.
            > > >
            > > > Is there any way to do that?
            > >
            > > How about using i_CTRL-N or i_CTRL-P and set the 'complete' option
            > > accordingly?
            >
            > Of course. I hadn't thought of that. How blatantly
            > simple.
            >
            > After posting my question I realized I hadn't
            > mentioned the "[D" family of commands. It would be
            > nice for them to find my macro definitions too.
            >
            > Is there an easy way to do that too?

            Not that I can think of. I'm not all that familiar with those
            commands, though. All I could think of was a mapping to a grep of
            that makefile.

            Regards,
            Gary


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