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

Text color change, syntax or vim?

Expand Messages
  • Wei Wang
    hi, I am not a root user. How can I change the color of the text? Say the color of the highlighted matched string. Is this a syntax hightlight issue of the
    Message 1 of 8 , May 31, 2002
    • 0 Attachment
      hi,

      I am not a root user. How can I change the color of the text? Say the color
      of the highlighted matched string. Is this a syntax hightlight issue of the
      text color of the vim itself.


      Cheers,

      Wei
    • Colin Keith
      ... For instance I want all of my comments to be cyan so in my .vimrc I have: hi Comment term=bold ctermfg=cyan guifg=cyan But using the personal syntax
      Message 2 of 8 , May 31, 2002
      • 0 Attachment
        On Fri, May 31, 2002 at 06:35:14PM +0100, Wei Wang wrote:
        > I am not a root user. How can I change the color of the text? Say the color
        > of the highlighted matched string. Is this a syntax hightlight issue of the
        > text color of the vim itself.

        :help highlight
        :help runtimepath

        For instance I want all of my comments to be cyan so in my .vimrc I have:

        hi Comment term=bold ctermfg=cyan guifg=cyan

        But using the personal syntax directories (the rtp help entry) you can have
        your own syntax highlighting based on filetypes, etc.

        Colin
      • Wei Wang
        Thanks a lot. BTW, how to cancel a search? On Fri, 31 May 2002 19:08:24 +0100
        Message 3 of 8 , May 31, 2002
        • 0 Attachment
          Thanks a lot.

          BTW, how to cancel a search?


          On Fri, 31 May 2002 19:08:24 +0100
          Colin Keith <vim@...> wrote:

          > On Fri, May 31, 2002 at 06:35:14PM +0100, Wei Wang wrote:
          > > I am not a root user. How can I change the color of the text? Say the color
          > > of the highlighted matched string. Is this a syntax hightlight issue of the
          > > text color of the vim itself.
          >
          > :help highlight
          > :help runtimepath
          >
          > For instance I want all of my comments to be cyan so in my .vimrc I have:
          >
          > hi Comment term=bold ctermfg=cyan guifg=cyan
          >
          > But using the personal syntax directories (the rtp help entry) you can have
          > your own syntax highlighting based on filetypes, etc.
          >
          > Colin
          >
        • Colin Keith
          ... ? Urm... do you mean stop it highlighting matches?
          Message 4 of 8 , May 31, 2002
          • 0 Attachment
            On Fri, May 31, 2002 at 08:39:04PM +0100, Wei Wang wrote:
            > Thanks a lot.
            >
            > BTW, how to cancel a search?

            ? Urm... do you mean stop it highlighting matches?
            Turn off the hightlights:


            :help hlsearch
          • Wei Wang
            That s an option, too. What I want is actually get rid of the search. Say I did a search in one file and the results are highlighted which is what I want. Then
            Message 5 of 8 , May 31, 2002
            • 0 Attachment
              That's an option, too.
              What I want is actually get rid of the search. Say I did a search in one file
              and the results are highlighted which is what I want. Then I close this file andopen another file with vim. The search is applied in this file as well, which
              is not what I want. When I freshly open an vim, there is no search and no
              corresponding highlight. How can I get back to this initial state after doing
              several searches?




              On Fri, 31 May 2002 20:41:20 +0100
              Colin Keith <vim@...> wrote:

              > On Fri, May 31, 2002 at 08:39:04PM +0100, Wei Wang wrote:
              > > Thanks a lot.
              > >
              > > BTW, how to cancel a search?
              >
              > ? Urm... do you mean stop it highlighting matches?
              > Turn off the hightlights:
              >
              >
              > :help hlsearch
              >
              >
            • Antoine J. Mechelynck
              either :nohls to just turn off highlighting until next search, or ... Tony. ... From: Wei Wang To: Colin Keith
              Message 6 of 8 , May 31, 2002
              • 0 Attachment
                either :nohls to just turn off highlighting until next search, or
                :let @/="" to also empty the last-search register.

                Tony.
                ----- Original Message -----
                From: "Wei Wang" <Wei.Wang@...>
                To: "Colin Keith" <vim@...>
                Cc: <vim@...>
                Sent: Friday, May 31, 2002 9:54 PM
                Subject: Re: Text color change, syntax or vim?


                > That's an option, too.
                > What I want is actually get rid of the search. Say I did a search in one
                file
                > and the results are highlighted which is what I want. Then I close this
                file andopen another file with vim. The search is applied in this file as
                well, which
                > is not what I want. When I freshly open an vim, there is no search and no
                > corresponding highlight. How can I get back to this initial state after
                doing
                > several searches?
                >
                >
                >
                >
                > On Fri, 31 May 2002 20:41:20 +0100
                > Colin Keith <vim@...> wrote:
                >
                > > On Fri, May 31, 2002 at 08:39:04PM +0100, Wei Wang wrote:
                > > > Thanks a lot.
                > > >
                > > > BTW, how to cancel a search?
                > >
                > > ? Urm... do you mean stop it highlighting matches?
                > > Turn off the hightlights:
                > >
                > >
                > > :help hlsearch
                > >
                > >
                >
                >
              • Colin Keith
                ... I think you want.
                Message 7 of 8 , May 31, 2002
                • 0 Attachment
                  On Fri, May 31, 2002 at 08:54:22PM +0100, Wei Wang wrote:
                  > What I want is actually get rid of the search. Say I did a search in one file
                  > and the results are highlighted which is what I want. Then I close this file
                  > andopen another file with vim. The search is applied in this file as well,

                  :help 'viminfo'

                  I think you want.

                  :set viminfo-=h
                • Benji Fisher
                  ... You might want to put this in an autocommand, ... I leave it as an exercise to make BufLeave/BufEnter autocommands to save the search register as a buffer
                  Message 8 of 8 , Jun 2, 2002
                  • 0 Attachment
                    "Antoine J. Mechelynck" wrote:
                    > ----- Original Message -----
                    > From: "Wei Wang" <Wei.Wang@...>
                    > To: "Colin Keith" <vim@...>
                    > Cc: <vim@...>
                    > Sent: Friday, May 31, 2002 9:54 PM
                    > Subject: Re: Text color change, syntax or vim?
                    >
                    > > That's an option, too.
                    > > What I want is actually get rid of the search. Say I did a search in one
                    > file
                    > > and the results are highlighted which is what I want. Then I close this
                    > file andopen another file with vim. The search is applied in this file as
                    > well, which
                    > > is not what I want. When I freshly open an vim, there is no search and no
                    > > corresponding highlight. How can I get back to this initial state after
                    > doing
                    > > several searches?
                    >
                    > either :nohls to just turn off highlighting until next search, or
                    > :let @/="" to also empty the last-search register.
                    >
                    > Tony.

                    You might want to put this in an autocommand,

                    :au BufEnter nohls

                    I leave it as an exercise to make BufLeave/BufEnter autocommands to save the
                    search register as a buffer variable, then either turn off search highlighting
                    (:noh) or restore the search history when changing buffers. (The hard part is
                    to avoid setting a buffer variable for bar.txt if you do

                    :e foo.txt
                    /foo
                    :e bar.txt
                    :e foo.txt

                    for example). OTOH, this is not always useful: often I want to keep the
                    search pattern as I switch from buffer to buffer.

                    HTH --Benji Fisher
                  Your message has been successfully submitted and would be delivered to recipients shortly.