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

Re: syntax highlighting problems

Expand Messages
  • Paul J. Sala
    Antoine, I tired :syntax off and it did not fully work. Some of the highlighting went away but when I scroll past this text in a file I m editing:
    Message 1 of 7 , Jul 21 12:56 PM
    • 0 Attachment
      Antoine,

      I tired :syntax off and it did not fully work. Some of the highlighting went
      away but when I scroll past this text in a file I'm editing:

      #<VirtualHost host.some_domain.com>
      #ServerAdmin webmaster@..._domain.com
      #DocumentRoot /www/docs/host.some_domain.com
      #ServerName host.some_domain.com


      this is what happens, at first the backgraound is black and the text is blue.
      When I scroll past the above text, all of a sudden, the background from the "D"
      in DocumentRoot thru the rest of the file changes to yellow.

      And then, even when I exit vim, my background is still yellow in my aixterm.

      argh!!!

      ........Paul

      -------------------------------------------
      >>>"Antoine J. Mechelynck" said:
      > Paul J. Sala <psala@...> wrote:
      > > Hi All,
      > >
      > > Help!!!!
      > >
      > > I received a few replies on this, but none of the suggestions worked.
      > > This is driving me crazy as I can't edit some files because at some
      > > put highlight changes to a yellow background with a virtual
      > > unreadable skyblue foreground text.
      > >
      > > Does anyone have any other ideas.
      > >
      > > Thanks........Paul
      > >
      > > ------- Forwarded Message
      > >
      > > To: vim@...
      > > Subject: syntax highlighting problems
      > > Date: Thu, 10 Jul 2003 09:21:18 -0400
      > > From: "Paul J. Sala" <psala@...>
      > > Status:
      > >
      > >
      > > Hi,
      > >
      > > I am using VIM 6.1 on RedHat Linux 7.3. I remotely log into the linux
      > > server thru a terminal window.
      > >
      > > When I edit some files with vim I get undesired highlighting.
      > > Initially the colors may look OK, but as I scroll thru the file the
      > > colors change and remain even after I exit vim. Sometimes the
      > > background is yellow and the foreground is lightblue, which makes it
      > > very hard to read anything.
      > >
      > > The only way I can get normal colors back in my linux terminal window
      > > is to issue these comands: "tput setf 7" and "tput setb 0".
      > >
      > >
      > > I have tried putting ":syntax off" in my .vimrc file. I even tried
      > > running the command: ":syn off" in the editor, but as soon as I
      > > scroll down past certain characters in the file, the colors change.
      > >
      > > Question: how do I turn off any and all highlighting in vim?
      > >
      > >
      > > > From offlist suggestions I tried :syntax clear but that did not
      > > > help.
      > >
      > > One person suggested my problem may have something to do with a
      > > terminfo file. I looked at:
      > >
      > > > he terminal-info
      > > > he term
      > >
      > > which lead me to believe this may be the case. But I do not know
      > > which terminfo file vim is using. And what should I change in the
      > > terminfo file to stop highlighting.
      > >
      > > Also I did not mention that I am using VIM 6.1 on RedHat Linux 7.3
      > > I telnet to the linux 7.3 server from an aix 4.3.3 aixterm window.
      > >
      > > Thanks........Paul
      > >
      > > ------- End of Forwarded Message
      >
      > If it's really driving you crazy, you could remove syntax coloring with
      >
      > :syntax off
      >
      > For more information, see
      >
      > :help syntax.txt
      >
      > HTH,
      > Tony.
      >

      _____________________________________________________________________
      Paul Sala | EMAIL: psala@...
    • Antoine J. Mechelynck
      ... What is your t_Co (as shown by :set t_Co? or by :set termcap)? Does setting it to 2 (black-and-white) change anything? Another possibility: Is a
      Message 2 of 7 , Jul 21 1:12 PM
      • 0 Attachment
        Paul J. Sala <psala@...> wrote:
        > Antoine,
        >
        > I tired :syntax off and it did not fully work. Some of the
        > highlighting went away but when I scroll past this text in a file I'm
        > editing:
        >
        > #<VirtualHost host.some_domain.com>
        > #ServerAdmin webmaster@..._domain.com
        > #DocumentRoot /www/docs/host.some_domain.com
        > #ServerName host.some_domain.com
        >
        >
        > this is what happens, at first the backgraound is black and the text
        > is blue. When I scroll past the above text, all of a sudden, the
        > background from the "D" in DocumentRoot thru the rest of the file
        > changes to yellow.
        >
        > And then, even when I exit vim, my background is still yellow in my
        > aixterm.
        >
        > argh!!!
        >
        > ........Paul

        What is your t_Co (as shown by :set t_Co? or by :set termcap)? Does setting
        it to 2 (black-and-white) change anything?

        Another possibility: Is a colorscheme loaded? (if yes, :echo colors_name
        will tell you which one) Maybe loading one (:help :colorscheme) will make
        those ugly colors go away?

        Regards,
        Tony.
      • Dan Sharp
        ... Well, the good news (kind of) is that I was able to reproduce this. The bad news is that I don t know what caused it. I opened an aixterm (AIX 4.3.2) and
        Message 3 of 7 , Jul 21 1:22 PM
        • 0 Attachment
          Paul J. Sala wrote:
          > Antoine,
          >
          > I tired :syntax off and it did not fully work. Some of the highlighting went
          > away but when I scroll past this text in a file I'm editing:
          >
          > #<VirtualHost host.some_domain.com>
          > #ServerAdmin webmaster@..._domain.com
          > #DocumentRoot /www/docs/host.some_domain.com
          > #ServerName host.some_domain.com
          >
          >
          > this is what happens, at first the backgraound is black and the text is blue.
          > When I scroll past the above text, all of a sudden, the background from the "D"
          > in DocumentRoot thru the rest of the file changes to yellow.
          >
          > And then, even when I exit vim, my background is still yellow in my aixterm.

          Well, the good news (kind of) is that I was able to reproduce this. The
          bad news is that I don't know what caused it. I opened an aixterm (AIX
          4.3.2) and telneted to a RedHat 7.3 box and started Vim editing the
          misc2.c file from the Vim source. The aixterm was originally dark navy
          blue with green text. When I first opened the file and scrolled up and
          down the file, everything was fine. Then I did a ':syntax on', which
          changed the highlighting of the source. After paging down two or three
          screens it suddenly changed to a yellow background. I did a ':syntax
          off' and the code lost the syntax highlighting, but the background was
          still yellow and remained so after exiting Vim.

          When I have a bit more time I will try to look into it some more. I
          just wanted to let you know that the problem was reproducible and not
          just you :)

          Dan Sharp
        • Paul J. Sala
          Hi Antoine, Here are the answers to your questions: I entered :t_Co and got: t_Co=8 ... t_AB=^[[4%p1%dm t_cs= t_ke=
          Message 4 of 7 , Jul 22 6:19 AM
          • 0 Attachment
            Hi Antoine,


            Here are the answers to your questions:


            I entered :t_Co and got: t_Co=8



            I entered :set termcap and got:
            --- Terminal codes ---
            t_AB=^[[4%p1%dm t_cs= t_ke= t_RI=^[[%p1%dC
            t_vb=
            t_AF=^[[3%p1%dm t_CV= t_ks= t_RV=
            t_ve=
            t_AL=^[[%p1%dL t_ut= t_le=^H t_se=^[[m
            t_vi=
            t_al=^[[L t_da= t_mb= t_so=^[[7m
            t_vs=
            t_bc= t_db= t_md=^[[1m t_sr=
            t_WP=
            t_cd=^[[J t_DL=^[[%p1%dM t_me=^[[0;10m^[(B t_ts=^[[?%p1%dT
            t_WS=
            t_ce=^[[K t_dl=^[[M t_mr=^[[7m t_te=
            t_xs=
            t_cl=^[[H^[[J t_fs=^[[?F t_ms=y t_ti=
            t_ZH=^[[7m
            t_Co=8 t_IE= t_nd=^[[C t_ue=^[[m
            t_ZR=^[[0;10m^[(B
            t_CS= t_IS= t_op=^[[32m^[[40m t_us=^[[4m
            t_cm=^[[%i%p1%d;%p2%dH
            t_Sb=^[[%?%p1%{0}%=%t40m%e%p1%{1}%=%t41m%e%p1%{2}%=%t42m%e%p1%{3}%=%t43m%e%p1%
            {4}%=%t44m%e%p1%{5}%=%t45m
            %e%p1%{6}%=%t46m%e%p1%{7}%=%t107m%;
            t_Sf=^[[%?%p1%{0}%=%t30m%e%p1%{1}%=%t31m%e%p1%{2}%=%t32m%e%p1%{3}%=%t33m%e%p1%
            {4}%=%t34m%e%p1%{5}%=%t35m
            %e%p1%{6}%=%t36m%e%p1%{7}%=%t97m%;
            --- Terminal keys ---
            t_@7 <End> ^[[146q t_k5 <F5> ^[[005q t_kI <Insert> ^[[139q
            t_kr <Right> ^[[C
            t_F1 <F11> ^[[011q t_k6 <F6> ^[[006q t_kN <PageDown> ^[[154q
            t_ku <Up> ^[[A
            t_F2 <F12> ^[[012q t_k7 <F7> ^[[007q t_kP <PageUp> ^[[150q
            <DecMouse> ^[[
            t_k1 <F1> ^[[001q t_k8 <F8> ^[[008q t_kb <BS> ^H
            <NetMouse> ^[}
            t_k2 <F2> ^[[002q t_k9 <F9> ^[[009q t_kd <Down> ^[[B
            <Mouse> ^[MG
            t_k3 <F3> ^[[003q t_k; <F10> ^[[010q t_kh <Home> ^[[H
            t_k4 <F4> ^[[004q t_kD <Del> ^[[P t_kl <Left> ^[[D



            Before I changed t_Co my bg=black, fg = some text darkblue, some lightblue

            After I changed t_Co to t_Co=2 my bg=black, fg = some text red, yellow, liteblue


            I did this ":echo colors_name" and got:
            E121: Undefined variable: colors_name
            E15: Invalid expression: colors_name



            I did this ":hi" and got:
            :hi
            SpecialKey xxx term=bold ctermfg=4
            NonText xxx term=bold cterm=bold ctermfg=4
            Directory xxx term=bold ctermfg=4
            ErrorMsg xxx term=standout cterm=bold ctermfg=7 ctermbg=1
            IncSearch xxx term=reverse cterm=reverse
            Search xxx term=reverse ctermbg=3
            MoreMsg xxx term=bold ctermfg=2
            ModeMsg xxx term=bold cterm=bold
            LineNr xxx term=underline ctermfg=3
            Question xxx term=standout ctermfg=2
            StatusLine xxx term=bold,reverse cterm=bold,reverse
            StatusLineNC xxx term=reverse cterm=reverse
            VertSplit xxx term=reverse cterm=reverse
            Title xxx term=bold ctermfg=5
            Visual xxx term=reverse cterm=reverse
            VisualNOS xxx term=bold,underline cterm=bold,underline
            WarningMsg xxx term=standout ctermfg=1
            WildMenu xxx term=standout ctermfg=0 ctermbg=3
            Folded xxx term=standout ctermfg=4 ctermbg=7
            FoldColumn xxx term=standout ctermfg=4 ctermbg=7
            DiffAdd xxx term=bold ctermbg=4
            DiffChange xxx term=bold ctermbg=5
            DiffDelete xxx term=bold cterm=bold ctermfg=4 ctermbg=6
            DiffText xxx term=reverse cterm=bold ctermbg=1
            Comment xxx term=bold ctermfg=4
            Constant xxx term=underline ctermfg=1
            Special xxx term=bold ctermfg=5
            Identifier xxx term=underline ctermfg=6
            Statement xxx term=bold ctermfg=3
            PreProc xxx term=underline ctermfg=5
            Type xxx term=underline ctermfg=2
            Underlined xxx term=underline cterm=underline ctermfg=5
            Ignore xxx cterm=bold ctermfg=7
            Error xxx term=reverse cterm=bold ctermfg=7 ctermbg=1
            Todo xxx term=standout ctermfg=0 ctermbg=3
            String xxx links to Constant
            Character xxx links to Constant
            Number xxx links to Constant
            Boolean xxx links to Constant
            Float xxx links to Number
            Function xxx links to Identifier
            Conditional xxx links to Statement
            Repeat xxx links to Statement
            Label xxx links to Statement
            Operator xxx links to Statement
            Keyword xxx links to Statement
            Exception xxx links to Statement
            Include xxx links to PreProc
            Define xxx links to PreProc
            Macro xxx links to PreProc
            PreCondit xxx links to PreProc
            StorageClass xxx links to Type
            Structure xxx links to Type
            Typedef xxx links to Type
            Tag xxx links to Special
            SpecialChar xxx links to Special
            Delimiter xxx links to Special
            SpecialComment xxx links to Special
            Debug xxx links to Special
            apacheFixme xxx links to Todo
            apacheComment xxx links to Comment
            apacheAnything xxx links to apacheOption
            apacheError xxx links to Error
            apacheString xxx links to Number
            apacheDeclaration xxx links to Function
            -- More --



            ........Paul


            -------------------------------------------
            >>>"Antoine J. Mechelynck" said:
            > Paul J. Sala <psala@...> wrote:
            > > Antoine,
            > >
            > > I tired :syntax off and it did not fully work. Some of the
            > > highlighting went away but when I scroll past this text in a file I'm
            > > editing:
            > >
            > > #<VirtualHost host.some_domain.com>
            > > #ServerAdmin webmaster@..._domain.com
            > > #DocumentRoot /www/docs/host.some_domain.com
            > > #ServerName host.some_domain.com
            > >
            > >
            > > this is what happens, at first the backgraound is black and the text
            > > is blue. When I scroll past the above text, all of a sudden, the
            > > background from the "D" in DocumentRoot thru the rest of the file
            > > changes to yellow.
            > >
            > > And then, even when I exit vim, my background is still yellow in my
            > > aixterm.
            > >
            > > argh!!!
            > >
            > > ........Paul
            >
            > What is your t_Co (as shown by :set t_Co? or by :set termcap)? Does setting
            > it to 2 (black-and-white) change anything?
            >
            > Another possibility: Is a colorscheme loaded? (if yes, :echo colors_name
            > will tell you which one) Maybe loading one (:help :colorscheme) will make
            > those ugly colors go away?
            >
            > Regards,
            > Tony.
            >
            >

            _____________________________________________________________________
            Paul Sala | EMAIL: psala@...
          • owen beresford
            On Mon, 21 Jul 2003 16:22:21 -0400, Dan Sharp ... *I think this is a stupid suggestion, but* have you got anything hilight? this is what yellow means on the
            Message 5 of 7 , Jul 23 6:23 AM
            • 0 Attachment
              On Mon, 21 Jul 2003 16:22:21 -0400, "Dan Sharp"
              <dwsharp@...> said:
              > Paul J. Sala wrote:
              > > Antoine,
              > >
              > > I tired :syntax off and it did not fully work. Some of the highlighting went
              > > away but when I scroll past this text in a file I'm editing:
              > >
              > > #<VirtualHost host.some_domain.com>
              > > #ServerAdmin webmaster@..._domain.com
              > > #DocumentRoot /www/docs/host.some_domain.com
              > > #ServerName host.some_domain.com
              > >
              > >
              > > this is what happens, at first the backgraound is black and the text is blue.
              > > When I scroll past the above text, all of a sudden, the background from the "D"
              > > in DocumentRoot thru the rest of the file changes to yellow.
              > >
              > > And then, even when I exit vim, my background is still yellow in my aixterm.
              >
              > Well, the good news (kind of) is that I was able to reproduce this. The
              > bad news is that I don't know what caused it. I opened an aixterm (AIX
              > 4.3.2) and telneted to a RedHat 7.3 box and started Vim editing the
              > misc2.c file from the Vim source. The aixterm was originally dark navy
              > blue with green text. When I first opened the file and scrolled up and
              > down the file, everything was fine. Then I did a ':syntax on', which
              > changed the highlighting of the source. After paging down two or three
              > screens it suddenly changed to a yellow background. I did a ':syntax
              > off' and the code lost the syntax highlighting, but the background was
              > still yellow and remained so after exiting Vim.
              >
              > When I have a bit more time I will try to look into it some more. I
              > just wanted to let you know that the problem was reproducible and not
              > just you :)

              *I think this is a stupid suggestion, but*
              have you got anything hilight?
              this is what yellow means on the default colour scheme

              is the mouse driver correctly set? I had problems with this, as the
              middle button was not responding correctly, and some times acted as
              select

              --
              owen
              --
              owen beresford
              owencanprogram@...

              --
              http://www.fastmail.fm - Same, same, but differentÂ…
            • Paul J. Sala
              Thanks to Dan for uncovering that termcap/terminfo thru an aixterm is the probable culprit here. Now is there anyone out there who could shed some light on
              Message 6 of 7 , Jul 24 6:52 AM
              • 0 Attachment
                Thanks to Dan for uncovering that termcap/terminfo thru an aixterm is the
                probable culprit here. Now is there anyone out there who could shed some light
                on what could be wrong with my termcp/terminfo on my aixterm when telneting
                into a RH linux 7.3 server.


                To answer Dan's question of: "How are you running the aixterm?"
                I log on to my aix 4.3.3 workstation, I bring up an aixterm, from the aixterm
                I telnet to the RH linux 7.3 server, then I use vim there.

                Is there a way to force the aixterm to never use colors of to turn off colors?

                If I do a: ls -l --color=auto the dir listing is colorized,
                if I do a: ls -l --color=never the dir listing is not colorized.
                But how do I set color=never permanently for my whole aixterm?


                .......Paul

                -------------------------------------------
                >>>Dan Sharp said:
                > Paul J. Sala wrote:
                > >>>away but when I scroll past this text in a file I'm editing:
                > >>>
                > >>>#<VirtualHost host.some_domain.com>
                > >>>#ServerAdmin webmaster@..._domain.com
                > >>>#DocumentRoot /www/docs/host.some_domain.com
                > >>>#ServerName host.some_domain.com
                > >>>
                > >>>
                > >>>this is what happens, at first the backgraound is black and the text is bl
                ue.
                > >>>When I scroll past the above text, all of a sudden, the background from th
                e "D"
                > >>>in DocumentRoot thru the rest of the file changes to yellow.
                > >>>
                > >>>And then, even when I exit vim, my background is still yellow in my aixter
                m
                > >
                > >>Well, the good news (kind of) is that I was able to reproduce this. The
                > >>bad news is that I don't know what caused it. I opened an aixterm (AIX
                > >>4.3.2) and telneted to a RedHat 7.3 box and started Vim editing the
                > >>misc2.c file from the Vim source. The aixterm was originally dark navy
                > >>blue with green text. When I first opened the file and scrolled up and
                > >>down the file, everything was fine. Then I did a ':syntax on', which
                > >>changed the highlighting of the source. After paging down two or three
                > >>screens it suddenly changed to a yellow background. I did a ':syntax
                > >>off' and the code lost the syntax highlighting, but the background was
                > >>still yellow and remained so after exiting Vim.
                > >>
                > >>When I have a bit more time I will try to look into it some more. I
                > >>just wanted to let you know that the problem was reproducible and not
                > >>just you :)
                >
                > This appears to be an aixterm problem. For some reason, when a program
                > tries to highlight some text in a new color, the escape sequence to
                > return to the 'normal' color is being ignored, so it isn't turned off,
                > causing all subsequent text to have that same highlighting.
                >
                > Someone who knows termcap / terminfo stuff may have some ideas what to
                > check. How are you running the aixterm? I telneted from a RH 7.3 box
                > and exported the display back to my local machine. In that case, I
                > don't know if it is using the local or remote termcap definitions.
                >
                > You can see the problem without even going into Vim. When you telnet to
                > the RedHat box, type
                > ls -l --color=auto
                > to get a colorized directory listing. For me, executables are
                > highlighted with green and directories with blue. In the output of the
                > above command, things look fine up until the first highlighted entry.
                > Any normal text after that entry will be that same color, until I hit
                > another entry that changes the color. So, for example, when I hit a
                > directory, all subsequent text is blue until I get to an executable
                > file, in which case all the following text turns green.
                >
                > The same thing was happening in Vim. With syntax off, all the text was
                > the same color. While scrolling down, I hit a long line that wrapped
                > off the bottom screen, so a blue @ was shown. This caused all
                > subsequent text to be highlighted blue. With syntax highlighting on,
                > when I hit a TODO: statement, which has a yellow background
                > highlighting, continued scrolling caused all the rest of the text to
                > have a yellow background.
                >
                > I'll have to leave possible fixes to someone who knows what they are
                > doing :)
                >
                > Dan Sharp
                >

                _____________________________________________________________________
                Paul Sala | EMAIL: psala@...
              • Paul J. Sala
                Well, it s not exactly what I was looking for but I found a fix. Instead of aixterm, I now use either xterm or dtterm. Color problems solved. ... I think to do
                Message 7 of 7 , Jul 29 12:21 PM
                • 0 Attachment
                  Well, it's not exactly what I was looking for but I found a fix.

                  Instead of aixterm, I now use either xterm or dtterm. Color problems solved.

                  Also, here is a possible solution from a linux forum that I did not try yet:

                  >So how do I modify my terminfo so that it prevents any output to the terminal
                  >from switching colors, regardless of what program is generating the output.

                  I think to do it right, you'd have to build a custom terminal type based on
                  aixterm but with the color-switching capabilities removed. And you'd have
                  to compile the definition with 'tic' and install it in /usr/share/terminfo.
                  That would be pretty hard. You could also just set TERM to some terminal
                  type that doesn't have color but is otherwise compatible with an aixterm.
                  I don't know what that would be; it may not exist. 'ansi', 'vt100', and
                  'vt320' are worth a try.


                  ......Paul
                Your message has been successfully submitted and would be delivered to recipients shortly.