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

Re: Change colour of cursor and matching bracket

Expand Messages
  • Bram Moolenaar
    ... I also use a different cursor color for Insert mode. It s nice, but recently it has started to cause terminal window flicker. I asked Thomas Dickey and
    Message 1 of 12 , Sep 30, 2012
    View Source
    • 0 Attachment
      Erik Christiansen wrote:

      > On 30.09.12 11:12, Dotan Cohen wrote:
      > > Where in the fine manual is it mentioned how to change the colour of
      > > the cursor and the colour of the matching parenthesis / bracket for
      > > all file types? I have tried ":h cursor color" and several other
      > > phrases, the only relevant one that I found it "h color" which did not
      > > lead me to the answer. I have tried "highlight MatchParen cterm=bold
      > > ctermfg=red ctermbg=blue" but this did not change the colour of the
      > > matching parenthesis or bracket.
      >
      > For the cursor, I just set the initial colour in the xterm:
      >
      > col='-fg yellow -bg darkslategrey -cr red' # Colours
      > /usr/bin/xterm $col # and lots more options.
      >
      > In Vim, I then only change the cursor colour to indicate whether we're
      > in insert mode or not, without having to look down at the status bar:
      >
      > " Cursor Appearance: (Insert_Mode == Green, Normal_Mode == Red)
      > if &term =~ "xterm"
      > let &t_SI = "\<Esc>]12;green\x7"
      > let &t_EI = "\<Esc>]12;red\x7"
      > endif
      >
      > But the method could be used in other contexts, I guess.
      >
      > As regards MatchParen colouring, I've only made sure that is turned
      > off, since it drove me nuts when I tried it. The bouncing cursor is more
      > than enough.

      I also use a different cursor color for Insert mode. It's nice, but
      recently it has started to cause terminal window flicker. I asked
      Thomas Dickey and he blames Ubuntu Compiz. I'm running Ubuntu 12.04 and
      an automatic update about a month ago started the problem. It first
      happened after a reboot, one of the updates before that must have caused
      it.

      Still don't know how to fix it. It gets a bit annoying. Searching for
      Ubuntu screen flicker has many hits, but I haven't spotted the right one
      yet.

      --
      VOICE OVER: As the horrendous Black Beast lunged forward, escape for Arthur
      and his knights seemed hopeless, when, suddenly ... the animator
      suffered a fatal heart attack.
      ANIMATOR: Aaaaagh!
      VOICE OVER: The cartoon peril was no more ... The Quest for Holy Grail could
      continue.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      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
    • Erik Christiansen
      ... On a new install of Ubuntu, two things seem invaluable; turning off NetworkManager before doing anything else, and ensuring that automatic upgrades are
      Message 2 of 12 , Sep 30, 2012
      View Source
      • 0 Attachment
        On 30.09.12 15:30, Bram Moolenaar wrote:
        > I also use a different cursor color for Insert mode. It's nice, but
        > recently it has started to cause terminal window flicker. I asked
        > Thomas Dickey and he blames Ubuntu Compiz. I'm running Ubuntu 12.04 and
        > an automatic update about a month ago started the problem. It first
        > happened after a reboot, one of the updates before that must have caused
        > it.

        On a new install of Ubuntu, two things seem invaluable; turning off
        NetworkManager before doing anything else, and ensuring that automatic
        upgrades are disabled. Stability is more conducive to sanity and
        productivity than having the latest bugs, ISTM. (OK, an occasional
        peek at the Update Manager, and acceptance of security upgrades, could
        let in a new bug too, but I've been fortunate so far.)

        Incidentally, to protect against unfortunate upgrades, I keep the older
        OS version, installing the new version in another partition. If it isn't
        much chop, it can be overwritten when a better one comes along. If it's
        OK, then installs alternate between partitions, clobbering the older
        version, as I upgrade once every 3 years or so.

        > Still don't know how to fix it. It gets a bit annoying. Searching for
        > Ubuntu screen flicker has many hits, but I haven't spotted the right one
        > yet.

        Giving up Compiz for Metacity or other WM, temporarily, might confirm
        that Compiz is the culprit. Then reversion to an older version ought to
        fix it, with a bit of luck. (An "apt-get remove --purge compiz"
        hopefully won't leave much of the current install, but e.g. with apache2
        I've had to clean out leftover subordinate packages.)

        Erik

        --
        A man is like a rusty wheel on a rusty cart,
        He sings his song as he rattles along and then he falls apart.
        - Richard Thompson

        --
        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
      • Dominique PellĂ©
        ... I also use different colors for the cursor in insert mode vs normal mode with xubuntu-12.04 (with all updates) and I have not noticed any flicker. Perhaps
        Message 3 of 12 , Sep 30, 2012
        View Source
        • 0 Attachment
          Bram Moolenaar wrote:

          > Erik Christiansen wrote:
          >
          >> On 30.09.12 11:12, Dotan Cohen wrote:
          >> > Where in the fine manual is it mentioned how to change the colour of
          >> > the cursor and the colour of the matching parenthesis / bracket for
          >> > all file types? I have tried ":h cursor color" and several other
          >> > phrases, the only relevant one that I found it "h color" which did not
          >> > lead me to the answer. I have tried "highlight MatchParen cterm=bold
          >> > ctermfg=red ctermbg=blue" but this did not change the colour of the
          >> > matching parenthesis or bracket.
          >>
          >> For the cursor, I just set the initial colour in the xterm:
          >>
          >> col='-fg yellow -bg darkslategrey -cr red' # Colours
          >> /usr/bin/xterm $col # and lots more options.
          >>
          >> In Vim, I then only change the cursor colour to indicate whether we're
          >> in insert mode or not, without having to look down at the status bar:
          >>
          >> " Cursor Appearance: (Insert_Mode == Green, Normal_Mode == Red)
          >> if &term =~ "xterm"
          >> let &t_SI = "\<Esc>]12;green\x7"
          >> let &t_EI = "\<Esc>]12;red\x7"
          >> endif
          >>
          >> But the method could be used in other contexts, I guess.
          >>
          >> As regards MatchParen colouring, I've only made sure that is turned
          >> off, since it drove me nuts when I tried it. The bouncing cursor is more
          >> than enough.
          >
          > I also use a different cursor color for Insert mode. It's nice, but
          > recently it has started to cause terminal window flicker. I asked
          > Thomas Dickey and he blames Ubuntu Compiz. I'm running Ubuntu 12.04 and
          > an automatic update about a month ago started the problem. It first
          > happened after a reboot, one of the updates before that must have caused
          > it.
          >
          > Still don't know how to fix it. It gets a bit annoying. Searching for
          > Ubuntu screen flicker has many hits, but I haven't spotted the right one
          > yet.


          I also use different colors for the cursor in insert mode
          vs normal mode with xubuntu-12.04 (with all updates)
          and I have not noticed any flicker. Perhaps you can
          try whether installing xfce solves your flicker issue:

          1/ sudo apt-get update
          2/ sudo apt-get install xubuntu-desktop
          3/ Log out.
          4/ Select xfce to login

          I remember having very slow refresh and flicker
          in vim a long time ago, and solved it at the time
          by installing the latest Nvidia driver.

          -- Dominique

          --
          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 Fritz
          ... This should have worked, assuming you re using Vim in a terminal and not gvim. For gvim you d need guifg and guibg highlights. See :help :highlight, :help
          Message 4 of 12 , Sep 30, 2012
          View Source
          • 0 Attachment
            On Sunday, September 30, 2012 4:12:21 AM UTC-5, dotancohen wrote:
            > Where in the fine manual is it mentioned how to change the colour of
            >
            > the cursor and the colour of the matching parenthesis / bracket for
            >
            > all file types?

            :he hl-Cursor
            :he hl-MatchParen

            > I have tried ":h cursor color" and several other
            >
            > phrases, the only relevant one that I found it "h color" which did not
            >
            > lead me to the answer. I have tried "highlight MatchParen cterm=bold
            >
            > ctermfg=red ctermbg=blue" but this did not change the colour of the
            >
            > matching parenthesis or bracket.
            >

            This should have worked, assuming you're using Vim in a terminal and not gvim. For gvim you'd need guifg and guibg highlights. See :help :highlight, :help highlight-args, and the following text for details on the command.

            >
            > It seems that no matter what I define in .vimrc, VIM still uses the
            >
            > reverse colours of the item (swap background and foreground) for the
            >
            > cursor

            You don't mention specifically what you tried, but the default cursor highlight (at least for my gvim install on Lubuntu) is guibg=fg guifg=bg, which would indeed reverse the color, so this makes sense if nothing you tried actually was correct. So what DID you try, if you can't get it working with a "hi Cursor ..." command?

            > and a cyan background for the matching parenthesis / bracket.
            >

            You used ctermfg and ctermbg, so I'll assume you're using a terminal (and a color one at that). Do the numbers (instead of the names) in :help cterm-colors work any better?

            What does :verbose hi Cursor and :verbose hi MatchParen show you? Perhaps the :hi command in your .vimrc is being overwritten later by a colorscheme command or something.

            Do :hi commands for other items work? Do you get colorful and customizable syntax highlighting, for example? Perhaps your terminal is misconfigured so that Vim doesn't realize it's a color terminal. I won't be much help in that regard, but I know you can cheat within Vim by setting t_Co and some other terminal codes. Do a :helpgrep t_Co and browse the list of hits for details. Or search the wiki: http://vim.wikia.com/wiki/index.php?search=t_Co&fulltext=Search

            --
            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
          • Bram Moolenaar
            ... I m using ATI/AMD. I tried installing their proprietery driver. Resulted in my desktop being 640 x 480 :-( Then running the display manager to change the
            Message 5 of 12 , Sep 30, 2012
            View Source
            • 0 Attachment
              Dominique Pelle wrote:

              > Bram Moolenaar wrote:
              >
              > > Erik Christiansen wrote:
              > >
              > >> On 30.09.12 11:12, Dotan Cohen wrote:
              > >> > Where in the fine manual is it mentioned how to change the colour of
              > >> > the cursor and the colour of the matching parenthesis / bracket for
              > >> > all file types? I have tried ":h cursor color" and several other
              > >> > phrases, the only relevant one that I found it "h color" which did not
              > >> > lead me to the answer. I have tried "highlight MatchParen cterm=bold
              > >> > ctermfg=red ctermbg=blue" but this did not change the colour of the
              > >> > matching parenthesis or bracket.
              > >>
              > >> For the cursor, I just set the initial colour in the xterm:
              > >>
              > >> col='-fg yellow -bg darkslategrey -cr red' # Colours
              > >> /usr/bin/xterm $col # and lots more options.
              > >>
              > >> In Vim, I then only change the cursor colour to indicate whether we're
              > >> in insert mode or not, without having to look down at the status bar:
              > >>
              > >> " Cursor Appearance: (Insert_Mode == Green, Normal_Mode == Red)
              > >> if &term =~ "xterm"
              > >> let &t_SI = "\<Esc>]12;green\x7"
              > >> let &t_EI = "\<Esc>]12;red\x7"
              > >> endif
              > >>
              > >> But the method could be used in other contexts, I guess.
              > >>
              > >> As regards MatchParen colouring, I've only made sure that is turned
              > >> off, since it drove me nuts when I tried it. The bouncing cursor is more
              > >> than enough.
              > >
              > > I also use a different cursor color for Insert mode. It's nice, but
              > > recently it has started to cause terminal window flicker. I asked
              > > Thomas Dickey and he blames Ubuntu Compiz. I'm running Ubuntu 12.04 and
              > > an automatic update about a month ago started the problem. It first
              > > happened after a reboot, one of the updates before that must have caused
              > > it.
              > >
              > > Still don't know how to fix it. It gets a bit annoying. Searching for
              > > Ubuntu screen flicker has many hits, but I haven't spotted the right one
              > > yet.
              >
              >
              > I also use different colors for the cursor in insert mode
              > vs normal mode with xubuntu-12.04 (with all updates)
              > and I have not noticed any flicker. Perhaps you can
              > try whether installing xfce solves your flicker issue:
              >
              > 1/ sudo apt-get update
              > 2/ sudo apt-get install xubuntu-desktop
              > 3/ Log out.
              > 4/ Select xfce to login
              >
              > I remember having very slow refresh and flicker
              > in vim a long time ago, and solved it at the time
              > by installing the latest Nvidia driver.

              I'm using ATI/AMD. I tried installing their proprietery driver.
              Resulted in my desktop being 640 x 480 :-( Then running the
              display manager to change the resulution has the OK button off-screen.
              AAAaaaargggg! Managed to hit it by pressing Tab the right number of
              times.

              Well, the flicker is less, it's just so short now that it is hardly
              noticeable. But the flicker is still there.

              --
              Sorry, no fortune today.

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              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
            • Marcin Szamotulski
              ... The flickering seems to be not just Ubuntu problem. I am running Gentoo and can observe it here. As a terminal I use uxterm (version 279). Best regards,
              Message 6 of 12 , Sep 30, 2012
              View Source
              • 0 Attachment
                On 23:53 Sun 30 Sep , Bram Moolenaar wrote:
                >
                > Dominique Pelle wrote:
                >
                > > Bram Moolenaar wrote:
                > >
                > > > Erik Christiansen wrote:
                > > >
                > > >> On 30.09.12 11:12, Dotan Cohen wrote:
                > > >> > Where in the fine manual is it mentioned how to change the colour of
                > > >> > the cursor and the colour of the matching parenthesis / bracket for
                > > >> > all file types? I have tried ":h cursor color" and several other
                > > >> > phrases, the only relevant one that I found it "h color" which did not
                > > >> > lead me to the answer. I have tried "highlight MatchParen cterm=bold
                > > >> > ctermfg=red ctermbg=blue" but this did not change the colour of the
                > > >> > matching parenthesis or bracket.
                > > >>
                > > >> For the cursor, I just set the initial colour in the xterm:
                > > >>
                > > >> col='-fg yellow -bg darkslategrey -cr red' # Colours
                > > >> /usr/bin/xterm $col # and lots more options.
                > > >>
                > > >> In Vim, I then only change the cursor colour to indicate whether we're
                > > >> in insert mode or not, without having to look down at the status bar:
                > > >>
                > > >> " Cursor Appearance: (Insert_Mode == Green, Normal_Mode == Red)
                > > >> if &term =~ "xterm"
                > > >> let &t_SI = "\<Esc>]12;green\x7"
                > > >> let &t_EI = "\<Esc>]12;red\x7"
                > > >> endif
                > > >>
                > > >> But the method could be used in other contexts, I guess.
                > > >>
                > > >> As regards MatchParen colouring, I've only made sure that is turned
                > > >> off, since it drove me nuts when I tried it. The bouncing cursor is more
                > > >> than enough.
                > > >
                > > > I also use a different cursor color for Insert mode. It's nice, but
                > > > recently it has started to cause terminal window flicker. I asked
                > > > Thomas Dickey and he blames Ubuntu Compiz. I'm running Ubuntu 12.04 and
                > > > an automatic update about a month ago started the problem. It first
                > > > happened after a reboot, one of the updates before that must have caused
                > > > it.
                > > >
                > > > Still don't know how to fix it. It gets a bit annoying. Searching for
                > > > Ubuntu screen flicker has many hits, but I haven't spotted the right one
                > > > yet.
                > >
                > >
                > > I also use different colors for the cursor in insert mode
                > > vs normal mode with xubuntu-12.04 (with all updates)
                > > and I have not noticed any flicker. Perhaps you can
                > > try whether installing xfce solves your flicker issue:
                > >
                > > 1/ sudo apt-get update
                > > 2/ sudo apt-get install xubuntu-desktop
                > > 3/ Log out.
                > > 4/ Select xfce to login
                > >
                > > I remember having very slow refresh and flicker
                > > in vim a long time ago, and solved it at the time
                > > by installing the latest Nvidia driver.
                >
                > I'm using ATI/AMD. I tried installing their proprietery driver.
                > Resulted in my desktop being 640 x 480 :-( Then running the
                > display manager to change the resulution has the OK button off-screen.
                > AAAaaaargggg! Managed to hit it by pressing Tab the right number of
                > times.
                >
                > Well, the flicker is less, it's just so short now that it is hardly
                > noticeable. But the flicker is still there.
                >
                > --
                > Sorry, no fortune today.
                >
                > /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                > \\\ an exciting new programming language -- http://www.Zimbu.org ///
                > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                The flickering seems to be not just Ubuntu problem. I am running Gentoo
                and can observe it here. As a terminal I use uxterm (version 279).

                Best regards,
                Marcin

                --
                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
              • Bram Moolenaar
                ... Could it be a problem with Gnome desktop? I should try out xfce. I deinstalled the ATI driver again. It was causing display errors for images in Chrome.
                Message 7 of 12 , Oct 1, 2012
                View Source
                • 0 Attachment
                  Marcin Szamotulski wrote:

                  > On 23:53 Sun 30 Sep , Bram Moolenaar wrote:
                  > >
                  > > Dominique Pelle wrote:
                  > >
                  > > > Bram Moolenaar wrote:
                  > > >
                  > > > > Erik Christiansen wrote:
                  > > > >
                  > > > >> On 30.09.12 11:12, Dotan Cohen wrote:
                  > > > >> > Where in the fine manual is it mentioned how to change the colour of
                  > > > >> > the cursor and the colour of the matching parenthesis / bracket for
                  > > > >> > all file types? I have tried ":h cursor color" and several other
                  > > > >> > phrases, the only relevant one that I found it "h color" which did not
                  > > > >> > lead me to the answer. I have tried "highlight MatchParen cterm=bold
                  > > > >> > ctermfg=red ctermbg=blue" but this did not change the colour of the
                  > > > >> > matching parenthesis or bracket.
                  > > > >>
                  > > > >> For the cursor, I just set the initial colour in the xterm:
                  > > > >>
                  > > > >> col='-fg yellow -bg darkslategrey -cr red' # Colours
                  > > > >> /usr/bin/xterm $col # and lots more options.
                  > > > >>
                  > > > >> In Vim, I then only change the cursor colour to indicate whether we're
                  > > > >> in insert mode or not, without having to look down at the status bar:
                  > > > >>
                  > > > >> " Cursor Appearance: (Insert_Mode == Green, Normal_Mode == Red)
                  > > > >> if &term =~ "xterm"
                  > > > >> let &t_SI = "\<Esc>]12;green\x7"
                  > > > >> let &t_EI = "\<Esc>]12;red\x7"
                  > > > >> endif
                  > > > >>
                  > > > >> But the method could be used in other contexts, I guess.
                  > > > >>
                  > > > >> As regards MatchParen colouring, I've only made sure that is turned
                  > > > >> off, since it drove me nuts when I tried it. The bouncing cursor is more
                  > > > >> than enough.
                  > > > >
                  > > > > I also use a different cursor color for Insert mode. It's nice, but
                  > > > > recently it has started to cause terminal window flicker. I asked
                  > > > > Thomas Dickey and he blames Ubuntu Compiz. I'm running Ubuntu 12.04 and
                  > > > > an automatic update about a month ago started the problem. It first
                  > > > > happened after a reboot, one of the updates before that must have caused
                  > > > > it.
                  > > > >
                  > > > > Still don't know how to fix it. It gets a bit annoying. Searching for
                  > > > > Ubuntu screen flicker has many hits, but I haven't spotted the right one
                  > > > > yet.
                  > > >
                  > > >
                  > > > I also use different colors for the cursor in insert mode
                  > > > vs normal mode with xubuntu-12.04 (with all updates)
                  > > > and I have not noticed any flicker. Perhaps you can
                  > > > try whether installing xfce solves your flicker issue:
                  > > >
                  > > > 1/ sudo apt-get update
                  > > > 2/ sudo apt-get install xubuntu-desktop
                  > > > 3/ Log out.
                  > > > 4/ Select xfce to login
                  > > >
                  > > > I remember having very slow refresh and flicker
                  > > > in vim a long time ago, and solved it at the time
                  > > > by installing the latest Nvidia driver.
                  > >
                  > > I'm using ATI/AMD. I tried installing their proprietery driver.
                  > > Resulted in my desktop being 640 x 480 :-( Then running the
                  > > display manager to change the resulution has the OK button off-screen.
                  > > AAAaaaargggg! Managed to hit it by pressing Tab the right number of
                  > > times.
                  > >
                  > > Well, the flicker is less, it's just so short now that it is hardly
                  > > noticeable. But the flicker is still there.
                  > >
                  > > --
                  > > Sorry, no fortune today.
                  > >
                  > > /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  > > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  > > \\\ an exciting new programming language -- http://www.Zimbu.org ///
                  > > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                  >
                  > The flickering seems to be not just Ubuntu problem. I am running Gentoo
                  > and can observe it here. As a terminal I use uxterm (version 279).

                  Could it be a problem with Gnome desktop? I should try out xfce.

                  I deinstalled the ATI driver again. It was causing display errors for
                  images in Chrome. I suspect it also caused my focus-follows-mouse
                  setting to be lost. Seems like a bad driver.

                  --
                  BRIDGEKEEPER: What is your favorite colour?
                  GAWAIN: Blue ... No yelloooooww!
                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ an exciting new programming language -- http://www.Zimbu.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                  --
                  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
                • François Ingelrest
                  ... When the window goes out of the screen, you can generally hold the ALT key to drag the window by clicking anywhere on it. This way you can move the bottom
                  Message 8 of 12 , Oct 1, 2012
                  View Source
                  • 0 Attachment
                    On Sun, Sep 30, 2012 at 11:53 PM, Bram Moolenaar wrote:
                    > I'm using ATI/AMD. I tried installing their proprietery driver.
                    > Resulted in my desktop being 640 x 480 :-( Then running the
                    > display manager to change the resulution has the OK button off-screen.
                    > AAAaaaargggg! Managed to hit it by pressing Tab the right number of
                    > times.

                    When the window goes out of the screen, you can generally hold the ALT
                    key to drag the window by clicking anywhere on it. This way you can
                    move the bottom buttons back on screen.

                    --
                    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
                  • Dotan Cohen
                    ... Thank you, but that just leads to a link to Syntax highlighting. Ostensibly this is what I want, but on my system (Kubuntu with VIM 7.3 running in Konsole,
                    Message 9 of 12 , Oct 2, 2012
                    View Source
                    • 0 Attachment
                      On Sun, Sep 30, 2012 at 11:20 PM, Ben Fritz <fritzophrenic@...> wrote:
                      > On Sunday, September 30, 2012 4:12:21 AM UTC-5, dotancohen wrote:
                      >> Where in the fine manual is it mentioned how to change the colour of
                      >>
                      >> the cursor and the colour of the matching parenthesis / bracket for
                      >>
                      >> all file types?
                      >
                      > :he hl-Cursor
                      > :he hl-MatchParen
                      >

                      Thank you, but that just leads to a link to Syntax highlighting.
                      Ostensibly this is what I want, but on my system (Kubuntu with VIM 7.3
                      running in Konsole, and also tried SSHing into CentOS with VIM 7.2
                      from the same Konsole) configuration such as the following do not
                      change the matched parenthesis:

                      highlight MatchParen cterm=bold ctermfg=red ctermbg=blue


                      >> I have tried ":h cursor color" and several other
                      >>
                      >> phrases, the only relevant one that I found it "h color" which did not
                      >>
                      >> lead me to the answer. I have tried "highlight MatchParen cterm=bold
                      >>
                      >> ctermfg=red ctermbg=blue" but this did not change the colour of the
                      >>
                      >> matching parenthesis or bracket.
                      >>
                      >
                      > This should have worked, assuming you're using Vim in a terminal and not gvim. For gvim you'd need guifg and guibg highlights. See :help :highlight, :help highlight-args, and the following text for details on the command.
                      >

                      Yes, this was in VIM, not GVIM.


                      >> It seems that no matter what I define in .vimrc, VIM still uses the
                      >>
                      >> reverse colours of the item (swap background and foreground) for the
                      >>
                      >> cursor
                      >
                      > You don't mention specifically what you tried, but the default cursor highlight (at least for my gvim install on Lubuntu) is guibg=fg guifg=bg, which would indeed reverse the color, so this makes sense if nothing you tried actually was correct. So what DID you try, if you can't get it working with a "hi Cursor ..." command?
                      >
                      >> and a cyan background for the matching parenthesis / bracket.
                      >>
                      >
                      > You used ctermfg and ctermbg, so I'll assume you're using a terminal (and a color one at that). Do the numbers (instead of the names) in :help cterm-colors work any better?
                      >

                      No, unfortunately the numbers did not work either. I'll start playing
                      around with clean .vimrc and .vim/ to see if something in there is
                      interfering.


                      > What does :verbose hi Cursor and :verbose hi MatchParen show you? Perhaps the :hi command in your .vimrc is being overwritten later by a colorscheme command or something.
                      >
                      > Do :hi commands for other items work? Do you get colorful and customizable syntax highlighting, for example?

                      Yes, syntax highlighting works in all languages that I have tried.


                      > Perhaps your terminal is misconfigured so that Vim doesn't realize it's a color terminal. I won't be much help in that regard, but I know you can cheat within Vim by setting t_Co and some other terminal codes. Do a :helpgrep t_Co and browse the list of hits for details. Or search the wiki: http://vim.wikia.com/wiki/index.php?search=t_Co&fulltext=Search

                      Thanks, I'll get on that!


                      --
                      Dotan Cohen

                      http://gibberish.co.il
                      http://what-is-what.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.