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

Change color for source code comments

Expand Messages
  • Steven Woody
    after searched through google, i have not found a simple answer of how to change syntax highlight colors. especially, i want to change the comments color, that
    Message 1 of 7 , Oct 30, 2005
    • 0 Attachment
      after searched through google, i have not found a simple answer of how to
      change syntax highlight colors. especially, i want to change the comments
      color, that is too dark to see.

      i use vim in aterm/xterm without gui. sometimes, on windows, i also remotely
      login to linux box for using vim (in the case i set the terminal type to xterm
      in the terminal emulator's property).

      thanks in advance.

      --
      steven woody (id: narke)

      Celine: Well, who says relationships have to last forever?

      - Before Sunrise (1995)
    • Tim Chase
      ... The simplest way is to find a colorscheme more to your liking. To try them out, enter :colorscheme followed by a space and then hit control+D to list
      Message 2 of 7 , Oct 30, 2005
      • 0 Attachment
        > after searched through google, i have not found a simple answer of
        > how to change syntax highlight colors. especially, i want to change
        > the comments color, that is too dark to see.

        The simplest way is to find a colorscheme more to your liking. To try
        them out, enter ":colorscheme" followed by a space and then hit
        control+D to list the available colorschemes.

        If you find one that you like, simply put that line in your ~/.vimrc
        file, such as

        colorscheme elflord

        If you find one that's close to your liking, but still has room to be
        improved, you can copy the file from

        $VIMRUNTIME/colors/{colorscheme_name}.vim

        to

        ~/.vim/colors/{custom_name}.vim

        and then edit it to meet your wants. You'll likely want to change the
        line that assigns the colorscheme name to the new {custom_name}, which
        is likely on a line such as

        :let g:colors_name = "{colorscheme_name}"

        You can then modify the colors for your console and GUI as you see fit,
        making comments (and possibly other identifiers) easier on your eyes.

        For more info, check out

        :help colorscheme

        Hope this helps,

        -tim
      • Marian Csontos
        On Sun, 30 Oct 2005 13:41:59 +0100, Steven Woody ... Hi Steven, sometimes setting background helps. Some time ago here was a thread
        Message 3 of 7 , Oct 30, 2005
        • 0 Attachment
          On Sun, 30 Oct 2005 13:41:59 +0100, Steven Woody <narkewoody@...>
          wrote:

          > after searched through google, i have not found a simple answer of how to
          > change syntax highlight colors. especially, i want to change the comments
          > color, that is too dark to see.
          >
          > i use vim in aterm/xterm without gui. sometimes, on windows, i also
          > remotely
          > login to linux box for using vim (in the case i set the terminal type to
          > xterm
          > in the terminal emulator's property).
          >
          > thanks in advance.
          >

          Hi Steven,

          sometimes setting 'background' helps. Some time ago here was a thread
          about detecting it.

          Regards,

          -- Marian


          ________ Information from NOD32 ________
          This message was checked by NOD32 Antivirus System for Linux Mail Server.
          http://www.nod32.com
        • Charles E. Campbell, Jr.
          ... Hello! Three suggestions: * In your .vimrc, or manually: : set background=dark (or :set background=light) * Select a colorscheme that works for you
          Message 4 of 7 , Oct 31, 2005
          • 0 Attachment
            Steven Woody wrote:

            >after searched through google, i have not found a simple answer of how to
            >change syntax highlight colors. especially, i want to change the comments
            >color, that is too dark to see..snip
            >
            >

            Hello!

            Three suggestions:

            * In your .vimrc, or manually: : set background=dark (or :set
            background=light)
            * Select a colorscheme that works for you (there are plenty on
            http://vim.sf.net/)
            * Roll your own colorscheme, or modify one: hicolors, available at
            http://vim.sourceforge.net/scripts/script.php?script_id=1081
            visualizes your current colorscheme's standard colors and allows you
            to edit them.

            Regards,
            Chip Campbell
          • Gary Johnson
            ... Since Steven said he s using vim in an aterm or xterm, I don t think setting his colorscheme is going to help. Unless I m missing something, he s pretty
            Message 5 of 7 , Oct 31, 2005
            • 0 Attachment
              On 2005-10-31, "Charles E. Campbell, Jr." <drchip@...> wrote:
              > Steven Woody wrote:
              >
              > > after searched through google, i have not found a simple answer of how to
              > > change syntax highlight colors. especially, i want to change the comments
              > > color, that is too dark to see..snip
              > >
              > >
              >
              > Hello!
              >
              > Three suggestions:
              >
              > * In your .vimrc, or manually: : set background=dark (or :set
              > background=light)
              > * Select a colorscheme that works for you (there are plenty on
              > http://vim.sf.net/)
              > * Roll your own colorscheme, or modify one: hicolors, available at
              > http://vim.sourceforge.net/scripts/script.php?script_id=1081
              > visualizes your current colorscheme's standard colors and allows you
              > to edit them.

              Since Steven said he's using vim in an aterm or xterm, I don't think
              setting his colorscheme is going to help. Unless I'm missing
              something, he's pretty much stuck with his aterm's or xterm's
              palette.

              I, too, have found comments too dark. In my case, setting
              'background' to "dark" changed the comment color from blue to cyan,
              which was more readable, but not quite what I wanted. It also
              didn't help the visibility of other applications of blue as a
              foreground color, such as SpecialKey. I wound up changing the
              definition of "blue" in my .Xdefaults file to something that was
              visible both on a black background and as a background for white
              text.

              XTerm*VT100*color4: #70a0ff

              I've made a similar adjustment to the blue used by PuTTY, but I
              don't have those values handy at the moment.

              HTH,
              Gary

              --
              Gary Johnson | Agilent Technologies
              garyjohn@... | Wireless Division
              | Spokane, Washington, USA
            • A. J. Mechelynck
              ... [...] ... In any case, Steve, if you don t find a colorscheme exactly to your liking, you can always roll your own , and in that case you can write for
              Message 6 of 7 , Nov 1, 2005
              • 0 Attachment
                Charles E. Campbell, Jr. wrote:
                >
                > Steven Woody wrote:
                >>after searched through google, i have not found a simple answer of how to
                >>change syntax highlight colors. especially, i want to change the comments
                >>color, that is too dark to see..snip
                [...]
                > The astronaut colorscheme,
                > http://vim.sourceforge.net/scripts/script.php?script_id=122,
                > is designed to work with console vim in an xterm; ie. it is limited to
                > using 8 colors. It also
                > supports gvim using the same set of colors to permit a consistent look.
                > I prefer and the
                > astronaut colorscheme supports a dark background, by the way.
                >
                > I remember seeing some other colorscheme (whose name I don't remember)
                > that also
                > supported console. It may have been a 256-color xterm support, though.
                >
                > Regards,
                > Chip Campbell

                In any case, Steve, if you don't find a colorscheme exactly to your
                liking, you can always "roll your own", and in that case you can write
                for any or all of monochrome terminals (term=...), color console
                terminals (cterm=... ctermbg=... ctermfg=...), and GUI displays (gui=...
                guifg=... guibg=...). I'm attaching a very small colorscheme of mine,
                which leaves most (but not all) colours at their defaults; it will
                probably not be exactly what you want but you may use it as a source of
                inspiration. Like all user-made colorschemes, it belongs in the colors
                subdirectory of a directory listed before $VIMRUNTIME in the
                'runtimepath' option setting (e.g., in $VIM/vimfiles/colors/).

                Best regards,
                Tony.
              • Charles E. Campbell, Jr.
                ... ...snip The astronaut colorscheme, http://vim.sourceforge.net/scripts/script.php?script_id=122, is designed to work with console vim in an xterm; ie. it is
                Message 7 of 7 , Nov 1, 2005
                • 0 Attachment
                  Steven Woody wrote:
                  >after searched through google, i have not found a simple answer of how to
                  >change syntax highlight colors. especially, i want to change the comments
                  >color, that is too dark to see..snip

                  On 2005-10-31, "Charles E. Campbell, Jr." <drchip@...> wrote:
                  >Three suggestions:
                  >
                  >* In your .vimrc, or manually: : set background=dark (or :set
                  >background=light)
                  >* Select a colorscheme that works for you (there are plenty on
                  >http://vim.sf.net/)
                  >* Roll your own colorscheme, or modify one: hicolors, available at
                  > http://vim.sourceforge.net/scripts/script.php?script_id=1081
                  > visualizes your current colorscheme's standard colors and allows you
                  >to edit them.
                  >

                  Gary Johnson wrote:
                  >Since Steven said he's using vim in an aterm or xterm, I don't think
                  >setting his colorscheme is going to help. Unless I'm missing
                  >something, he's pretty much stuck with his aterm's or xterm's
                  >palette.
                  ...snip

                  The astronaut colorscheme,
                  http://vim.sourceforge.net/scripts/script.php?script_id=122,
                  is designed to work with console vim in an xterm; ie. it is limited to
                  using 8 colors. It also
                  supports gvim using the same set of colors to permit a consistent look.
                  I prefer and the
                  astronaut colorscheme supports a dark background, by the way.

                  I remember seeing some other colorscheme (whose name I don't remember)
                  that also
                  supported console. It may have been a 256-color xterm support, though.

                  Regards,
                  Chip Campbell
                Your message has been successfully submitted and would be delivered to recipients shortly.