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

Typedef and struct colors in console vi

Expand Messages
  • Ulrar
    Hi, I m new to vi, switching from emacs, and I m trying to configure the colorsheme. The only thing, my typedefs are colored the way I want but no the new
    Message 1 of 11 , May 2, 2011
    • 0 Attachment
      Hi,

      I'm new to vi, switching from emacs, and I'm trying to configure the
      colorsheme.
      The only thing, my typedefs are colored the way I want but no the new type.

      For example, if I write in a .h (in C) :
      typedef struct
      {
      //things
      } t_thing;

      The t_thing are not colored.
      In emacs the typedefs are considered as type like int or char, but in vi
      it's just text.
      Any idea of what I have to link to my Type ?

      An other thing, is there a way to color the prototype names ?
      like int main(void), just color the main ?
      The only way I found to color that is to change the text color, so the main
      content is colored too, and it's not what I want.

      Thanks for reading.

      --
      View this message in context: http://vim.1045645.n5.nabble.com/Typedef-and-struct-colors-in-console-vi-tp4365049p4365049.html
      Sent from the Vim - General mailing list archive at Nabble.com.

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Charles Campbell
      ... May I suggest Al Budden s http://www.vim.org/scripts/script.php?script_id=2646 Regards, Chip Campbell -- You received this message from the vim_use
      Message 2 of 11 , May 3, 2011
      • 0 Attachment
        Ulrar wrote:
        > Hi,
        >
        > I'm new to vi, switching from emacs, and I'm trying to configure the
        > colorsheme.
        > The only thing, my typedefs are colored the way I want but no the new type.
        >
        > For example, if I write in a .h (in C) :
        > typedef struct
        > {
        > //things
        > } t_thing;
        >
        > The t_thing are not colored.
        > In emacs the typedefs are considered as type like int or char, but in vi
        > it's just text.
        > Any idea of what I have to link to my Type ?
        >
        > An other thing, is there a way to color the prototype names ?
        > like int main(void), just color the main ?
        > The only way I found to color that is to change the text color, so the main
        > content is colored too, and it's not what I want.
        >
        >
        May I suggest Al Budden's

        http://www.vim.org/scripts/script.php?script_id=2646

        Regards,
        Chip Campbell

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Ulrar
        Thanks, but I can t have it working. I tried to :hi def link Structure Type And, in my colorscheme, Type is my group for all the char, int, ect. In the plugin
        Message 3 of 11 , May 5, 2011
        • 0 Attachment
          Thanks, but I can't have it working.
          I tried to :hi def link Structure Type
          And, in my colorscheme, Type is my group for all the char, int, ect.
          In the plugin doc I see that Typedef are in Type group so it is already in
          the right group, but nothing, the t_thing still white.

          I have runned the :UpdateFileType before, of course.
          What am I doing wrong ?

          --
          View this message in context: http://vim.1045645.n5.nabble.com/Typedef-and-struct-colors-in-console-vi-tp4365049p4372334.html
          Sent from the Vim - General mailing list archive at Nabble.com.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • A. S. Budden
          ... Are your source files all in the same directory and is it the directory reported by ... ? If they re not in the same directory, can you try using :cd to
          Message 4 of 11 , May 5, 2011
          • 0 Attachment
            On 5 May 2011 10:32, Ulrar <lemonnier.k@...> wrote:
            > Thanks, but I can't have it working.
            > I tried to :hi def link Structure Type
            > And, in my colorscheme, Type is my group for all the char, int, ect.
            > In the plugin doc I see that Typedef are in Type group so it is already in
            > the right group, but nothing, the t_thing still white.
            >
            > I have runned the :UpdateFileType before, of course.
            > What am I doing wrong ?

            Are your source files all in the same directory and is it the
            directory reported by

            :pwd

            ?

            If they're not in the same directory, can you try using ":cd" to
            change to the common parent and run:

            :UpdateTypesFile!

            (note the exclamation mark)?

            Is there a file called types_c.vim in the current directory? If so,
            can you check for a line with t_thing in it and post that to the list
            or my email address. If not, please can you run the following and
            post the result?

            :redir > output.log
            :let g:CTagsHighlighterDebug = g:DBG_Information
            :call UpdateTypesFile(1,0)
            :redir END

            the output will be saved in output.log... please post the contents.

            Al

            --
            http://sites.google.com/site/abudden

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Ulrar
            I have nothing ending in .vim in my directory, and yes I am in the right one. The output.log file : ... Looks like the --recurse option don t exist. I have vim
            Message 5 of 11 , May 5, 2011
            • 0 Attachment
              I have nothing ending in .vim in my directory, and yes I am in the right one.

              The output.log file :


              output.log wrote:
              >
              > Starting UpdateTypesFile revision r458
              > Looking for ctags in
              > /usr/local/bin,/usr/bin,/bin,/opt/bin,/usr/i686-pc-linux-gnu/gcc-bin/4.4.5,/usr/lib/subversion/bin,/usr/games/bin
              > Success.
              > Success.
              > python '/home/lemonn_k/.vim/mktypes.py' --ctags-dir=/usr/bin -r
              > --include-locals --ctags-file tags --types-prefix types
              > /usr/bin/ctags: unrecognized option '--recurse'
              > Try `/usr/bin/ctags --help' for a complete list of options.
              > Generating Tags
              > Generating types_c.vim
              > No tags found
              > Generating types_java.vim
              > No tags found
              > Generating types_pl.vim
              > No tags found
              > Generating types_py.vim
              > No tags found
              > Generating types_ruby.vim
              > No tags found
              > Generating types_vhdl.vim
              > No tags found
              > Generating types_php.vim
              > No tags found
              > Generating types_cs.vim
              > No tags found
              >
              > /usr/bin/ctags: unrecognized option '--recurse'^@^ITry `/usr/bin/ctags
              > --help' for a complete list of options.^@Generating Tags^@Generating
              > types_c.vim^@No tags found^@Generating types_java.vim^@No tags
              > found^@Generating types_pl.vim^@No tags found^@Generating types_py.vim^@No
              > tags found^@Generating types_ruby.vim^@No tags found^@Generating
              > types_vhdl.vim^@No tags found^@Generating types_php.vim^@No tags
              > found^@Generating types_cs.vim^@No tags found^@
              > Messages maintainer: Bram Moolenaar <Bram@...>
              > "exec.c" [converted] 63L, 1369C
              > Starting UpdateTypesFile revision r458
              > Looking for ctags in
              > /usr/local/bin,/usr/bin,/bin,/opt/bin,/usr/i686-pc-linux-gnu/gcc-bin/4.4.5,/usr/lib/subversion/bin,/usr/games/bin
              > Success.
              > Success.
              > /usr/bin/ctags: unrecognized option '--recurse'^@^ITry `/usr/bin/ctags
              > --help' for a complete list of options.^@Generating Tags^@Generating
              > types_c.vim^@No tags found^@Generating types_java.vim^@No tags
              > found^@Generating types_pl.vim^@No tags found^@Generating types_py.vim^@No
              > tags found^@Generating types_ruby.vim^@No tags found^@Generating
              > types_vhdl.vim^@No tags found^@Generating types_php.vim^@No tags
              > found^@Generating types_cs.vim^@No tags found
              >

              Looks like the --recurse option don't exist.
              I have vim 7.3.50 and ctags 5.7

              --
              View this message in context: http://vim.1045645.n5.nabble.com/Typedef-and-struct-colors-in-console-vi-tp4365049p4373123.html
              Sent from the Vim - General mailing list archive at Nabble.com.

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Ben Schmidt
              ... Looks like the script is finding /usr/bin/ctags, which is not Exuberant ctags 5.7 (which doesn t give the kind of error message above), but the ctags that
              Message 6 of 11 , May 5, 2011
              • 0 Attachment
                >> Looking for ctags in
                >> /usr/local/bin,/usr/bin,/bin,/opt/bin,/usr/i686-pc-linux-gnu/gcc-bin/4.4.5,/usr/lib/subversion/bin,/usr/games/bin
                ...
                >> /usr/bin/ctags: unrecognized option '--recurse'
                >> Try `/usr/bin/ctags --help' for a complete list of options.

                > Looks like the --recurse option don't exist.
                > I have vim 7.3.50 and ctags 5.7

                Looks like the script is finding /usr/bin/ctags, which is not Exuberant
                ctags 5.7 (which doesn't give the kind of error message above), but the
                ctags that comes with emacs (which does). Maybe you need to reorder your
                $PATH or something.

                Ben.



                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • A. S. Budden
                ... Agreed. It s one of the items on my wishlist to allow explicit customisation of the path to ctags (in case multiple versions are installed), but I haven t
                Message 7 of 11 , May 6, 2011
                • 0 Attachment
                  On 5 May 2011 20:40, Ben Schmidt <mail_ben_schmidt@...> wrote:
                  >>> Looking for ctags in
                  >>>
                  >>> /usr/local/bin,/usr/bin,/bin,/opt/bin,/usr/i686-pc-linux-gnu/gcc-bin/4.4.5,/usr/lib/subversion/bin,/usr/games/bin
                  >
                  > ...
                  >>>
                  >>> /usr/bin/ctags: unrecognized option '--recurse'
                  >>>        Try `/usr/bin/ctags --help' for a complete list of options.
                  >
                  >> Looks like the --recurse option don't exist.
                  >> I have vim 7.3.50 and ctags 5.7
                  >
                  > Looks like the script is finding /usr/bin/ctags, which is not Exuberant
                  > ctags 5.7 (which doesn't give the kind of error message above), but the
                  > ctags that comes with emacs (which does). Maybe you need to reorder your
                  > $PATH or something.

                  Agreed. It's one of the items on my wishlist to allow explicit
                  customisation of the path to ctags (in case multiple versions are
                  installed), but I haven't done this yet. Do you have exuberant ctags
                  installed? If so, where is it in the path? If rearranging the path
                  is an option, then I'd suggest that. Otherwise, I'll try to get that
                  fix done as soon as I can.

                  Al

                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Ulrar
                  Yeah, I have emacs but I didn t even know that there was a ctags with it ! I ve looked, I have that : /usr/bin/exuberant-ctags I guess I can t change the path,
                  Message 8 of 11 , May 6, 2011
                  • 0 Attachment
                    Yeah, I have emacs but I didn't even know that there was a ctags with it !

                    I've looked, I have that :
                    /usr/bin/exuberant-ctags

                    I guess I can't change the path, may be I can directly edit the plugin to
                    make it look for exuberant-ctags ?

                    --
                    View this message in context: http://vim.1045645.n5.nabble.com/Typedef-and-struct-colors-in-console-vi-tp4365049p4375440.html
                    Sent from the Vim - General mailing list archive at Nabble.com.

                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  • Christian Brabandt
                    Hi Ulrar! ... you could symlink /usr/bin/exuberant-ctags to e.g. ~/bin/ctags and put ~/bin in the beginning of your $PATH regards, Christian -- You received
                    Message 9 of 11 , May 6, 2011
                    • 0 Attachment
                      Hi Ulrar!

                      On Fr, 06 Mai 2011, Ulrar wrote:

                      > Yeah, I have emacs but I didn't even know that there was a ctags with it !
                      >
                      > I've looked, I have that :
                      > /usr/bin/exuberant-ctags
                      >
                      > I guess I can't change the path, may be I can directly edit the plugin to
                      > make it look for exuberant-ctags ?

                      you could symlink /usr/bin/exuberant-ctags to e.g. ~/bin/ctags and put
                      ~/bin in the beginning of your $PATH

                      regards,
                      Christian

                      --
                      You received this message from the "vim_use" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php
                    • A. S. Budden
                      ... That s a good plan. I ve implemented a fix in the plugin that should allow this to be customised, but I need to do a little more testing before it s
                      Message 10 of 11 , May 6, 2011
                      • 0 Attachment
                        On 6 May 2011 10:25, Christian Brabandt <cblists@...> wrote:
                        > Hi Ulrar!
                        >
                        > On Fr, 06 Mai 2011, Ulrar wrote:
                        >
                        >> Yeah, I have emacs but I didn't even know that there was a ctags with it !
                        >>
                        >> I've looked, I have that :
                        >> /usr/bin/exuberant-ctags
                        >>
                        >> I guess I can't change the path, may be I can directly edit the plugin to
                        >> make it look for exuberant-ctags ?
                        >
                        > you could symlink /usr/bin/exuberant-ctags to e.g. ~/bin/ctags and put
                        > ~/bin in the beginning of your $PATH

                        That's a good plan. I've implemented a fix in the plugin that should
                        allow this to be customised, but I need to do a little more testing
                        before it's released. In the meantime, the symlink should work well.

                        Al

                        --
                        You received this message from the "vim_use" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php
                      • Ulrar
                        Thank you, the link works perfectly ! Great plugin :) -- View this message in context:
                        Message 11 of 11 , May 6, 2011
                        • 0 Attachment
                          Thank you, the link works perfectly !

                          Great plugin :)

                          --
                          View this message in context: http://vim.1045645.n5.nabble.com/Typedef-and-struct-colors-in-console-vi-tp4365049p4375836.html
                          Sent from the Vim - General mailing list archive at Nabble.com.

                          --
                          You received this message from the "vim_use" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php
                        Your message has been successfully submitted and would be delivered to recipients shortly.