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

gui highlight in .vimrc fails

Expand Messages
  • Bee
    I have found a problem with the highlight command in MacVim. MacVim snapshot 53 -- osx 10.4.11 MacVim snapshot 60 -- osx 10.6.8 Neither one respects a gui
    Message 1 of 7 , Jan 7, 2012
    • 0 Attachment
      I have found a 'problem' with the highlight command in MacVim.
      MacVim snapshot 53 -- osx 10.4.11
      MacVim snapshot 60 -- osx 10.6.8

      Neither one respects a gui highlight in .vimrc such as:

      highlight Visual NONE ctermbg=Yellow ctermfg=Blue cterm=Bold
      guibg=Yellow guifg=Blue gui=Bold

      The same .vimrc works on MacOS with MacPorts gui vim-app 7.3.353 !
      The same .vimrc works on WinXP with gvim 7.3.386 !
      The same .vimrc works on Linux with gvim 7.3.372 !

      Since I do not have Lion, and will not any time soon, I can not test
      more a recent snapshot.

      ** Will this be or has this been changed or fixed? **

      I have added the gui highlight commands to .gvimrc and they work.

      It is just more convenient for them to be in the same highlight
      command.

      Bill

      --
      You received this message from the "vim_mac" 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
    • björn
      ... You should be able to work around this issue by adding the line let colors_name = mine to your ~/.vimrc file (substitute mine for whatever you like).
      Message 2 of 7 , Jan 8, 2012
      • 0 Attachment
        On 8 January 2012 00:00, Bee wrote:
        > I have found a 'problem' with the highlight command in MacVim.
        > MacVim snapshot 53 -- osx 10.4.11
        > MacVim snapshot 60 -- osx 10.6.8
        >
        > Neither one respects a gui highlight in .vimrc such as:
        >
        > highlight Visual NONE ctermbg=Yellow ctermfg=Blue cterm=Bold
        > guibg=Yellow guifg=Blue gui=Bold
        >
        > The same .vimrc works on MacOS with MacPorts gui vim-app 7.3.353 !
        > The same .vimrc works on WinXP with gvim 7.3.386 !
        > The same .vimrc works on Linux with gvim 7.3.372 !
        >
        > Since I do not have Lion, and will not any time soon, I can not test
        > more a recent snapshot.
        >
        > ** Will this be or has this been changed or fixed? **
        >
        > I have added the gui highlight commands to .gvimrc and they work.
        >
        > It is just more convenient for them to be in the same highlight
        > command.

        You should be able to work around this issue by adding the line

        let colors_name = "mine"

        to your ~/.vimrc file (substitute "mine" for whatever you like).

        The reason why you have to do this is that if colors_name is not set
        MacVim assumes the color scheme hasn't been modified and sets its own
        custom color scheme.

        Björn

        --
        You received this message from the "vim_mac" 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
      • Bee
        ... Thank you for the suggestion. At first I thought that worked, statusline, linenr, incsearch now all work. But then I tried to turn on/off syntax
        Message 3 of 7 , Jan 8, 2012
        • 0 Attachment
          On Jan 8, 8:07 am, björn <bjorn.winck...@...> wrote:
          > On 8 January 2012 00:00, Bee wrote:
          >
          >
          >
          >
          >
          > > I have found a 'problem' with the highlight command in MacVim.
          > > MacVim snapshot 53 -- osx 10.4.11
          > > MacVim snapshot 60 -- osx 10.6.8
          >
          > > Neither one respects a gui highlight in .vimrc such as:
          >
          > > highlight Visual NONE ctermbg=Yellow ctermfg=Blue cterm=Bold
          > > guibg=Yellow guifg=Blue gui=Bold
          >
          > > The same .vimrc works on MacOS with MacPorts gui vim-app 7.3.353 !
          > > The same .vimrc works on WinXP with gvim 7.3.386 !
          > > The same .vimrc works on Linux with gvim 7.3.372 !
          >
          > > Since I do not have Lion, and will not any time soon, I can not test
          > > more a recent snapshot.
          >
          > > ** Will this be or has this been changed or fixed? **
          >
          > > I have added the gui highlight commands to .gvimrc and they work.
          >
          > > It is just more convenient for them to be in the same highlight
          > > command.
          >
          > You should be able to work around this issue by adding the line
          >
          > let colors_name = "mine"
          >
          > to your ~/.vimrc file (substitute "mine" for whatever you like).
          >
          > The reason why you have to do this is that if colors_name is not set
          > MacVim assumes the color scheme hasn't been modified and sets its own
          > custom color scheme.
          >
          > Björn

          Thank you for the suggestion.
          At first I thought that worked, statusline, linenr, incsearch now all
          work.

          But then I tried to turn on/off syntax highlighting and got an error
          message:

          E185: Cannot find color scheme mine

          If I use a .gvimrc for the gui highlight commands, all my colors work.

          Ah but for one glitch, if I toggle syntax highlight (which works), the
          linenr and statusline change to something else (not mine).

          None of this happens on MacOS gui vim-app, Linux gvim, WinXP gvim,
          MacOS terminal vim, or Linux terminal vim.

          Bill

          --
          You received this message from the "vim_mac" 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
        • Kyle Lippincott
          The proper way of specifying highlights is with a colors file, which on mac should be in ~/.vim/colors/foo.vim, where foo is the name of the colorscheme. Then
          Message 4 of 7 , Jan 8, 2012
          • 0 Attachment
            The proper way of specifying highlights is with a colors file, which on mac should be in ~/.vim/colors/foo.vim, where foo is the name of the colorscheme.  Then you do 'syntax on' and 'color foo' in your .vimrc, and everything should work.  Note that the colors files have to set colors_name, so you'll want to make sure this is in your color file:
            :let g:colors_name="foo"

            You probably also want to guarantee vim understands the background color by having "set background=dark" (if it's dark) in the colorscheme file as well.

            This is supported on all the platforms and is the "proper" way to specify the colors so that it survives a :syntax off|syntax on.  If you want to investigate some of the included colorschemes, check out: :e $VIMRUNTIME/colors/desert.vim.

            To explain bjorn's answer a bit more:
            The gvimrc that comes with vim is loaded before yours (but after your .vimrc).  You can see a copy of this file by opening it with: :e $VIM/gvimrc (no leading period on the file name).  At the top it sets the default macvim color scheme, which is what's interfering with you.  


            On Sun, Jan 8, 2012 at 8:55 AM, Bee <beeyawned@...> wrote:


            On Jan 8, 8:07 am, björn <bjorn.winck...@...> wrote:
            > On 8 January 2012 00:00, Bee wrote:
            >
            >
            >
            >
            >
            > > I have found a 'problem' with the highlight command in MacVim.
            > > MacVim snapshot 53 -- osx 10.4.11
            > > MacVim snapshot 60 -- osx 10.6.8
            >
            > > Neither one respects a gui highlight in .vimrc such as:
            >
            > > highlight Visual NONE ctermbg=Yellow ctermfg=Blue cterm=Bold
            > > guibg=Yellow guifg=Blue gui=Bold
            >
            > > The same .vimrc works on MacOS with MacPorts gui vim-app 7.3.353 !
            > > The same .vimrc works on WinXP with gvim 7.3.386 !
            > > The same .vimrc works on Linux with gvim 7.3.372 !
            >
            > > Since I do not have Lion, and will not any time soon, I can not test
            > > more a recent snapshot.
            >
            > > ** Will this be or has this been changed or fixed? **
            >
            > > I have added the gui highlight commands to .gvimrc and they work.
            >
            > > It is just more convenient for them to be in the same highlight
            > > command.
            >
            > You should be able to work around this issue by adding the line
            >
            > let colors_name = "mine"
            >
            > to your ~/.vimrc file (substitute "mine" for whatever you like).
            >
            > The reason why you have to do this is that if colors_name is not set
            > MacVim assumes the color scheme hasn't been modified and sets its own
            > custom color scheme.
            >
            > Björn

            Thank you for the suggestion.
            At first I thought that worked, statusline, linenr, incsearch now all
            work.

            But then I tried to turn on/off syntax highlighting and got an error
            message:

            E185: Cannot find color scheme mine

            If I use a .gvimrc for the gui highlight commands, all my colors work.

            Ah but for one glitch, if I toggle syntax highlight (which works), the
            linenr and statusline change to something else (not mine).

            None of this happens on MacOS gui vim-app, Linux gvim, WinXP gvim,
            MacOS terminal vim, or Linux terminal vim.

            Bill

            --
            You received this message from the "vim_mac" 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

            --
            You received this message from the "vim_mac" 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
          • Bee
            ... Hello Bjorn I found a simple solution that works well for me. I would like to request the feature added to MacVim. I added a conditional to your
            Message 5 of 7 , Jan 12, 2012
            • 0 Attachment
              On Jan 8, 8:07 am, björn <bjorn.winck...@...> wrote:
              > On 8 January 2012 00:00, Bee wrote:
              >
              >
              >
              >
              >
              > > I have found a 'problem' with the highlight command in MacVim.
              > > MacVim snapshot 53 -- osx 10.4.11
              > > MacVim snapshot 60 -- osx 10.6.8
              >
              > > Neither one respects a gui highlight in .vimrc such as:
              >
              > > highlight Visual NONE ctermbg=Yellow ctermfg=Blue cterm=Bold
              > > guibg=Yellow guifg=Blue gui=Bold
              >
              > > The same .vimrc works on MacOS with MacPorts gui vim-app 7.3.353 !
              > > The same .vimrc works on WinXP with gvim 7.3.386 !
              > > The same .vimrc works on Linux with gvim 7.3.372 !
              >
              > > Since I do not have Lion, and will not any time soon, I can not test
              > > more a recent snapshot.
              >
              > > ** Will this be or has this been changed or fixed? **
              >
              > > I have added the gui highlight commands to .gvimrc and they work.
              >
              > > It is just more convenient for them to be in the same highlight
              > > command.
              >
              > You should be able to work around this issue by adding the line
              >
              > let colors_name = "mine"
              >
              > to your ~/.vimrc file (substitute "mine" for whatever you like).
              >
              > The reason why you have to do this is that if colors_name is not set
              > MacVim assumes the color scheme hasn't been modified and sets its own
              > custom color scheme.
              >
              > Björn


              Hello Bjorn

              I found a simple solution that works well for me.
              I would like to request the feature added to MacVim.

              I added a conditional to your $VIM/gvimrc

              if !exists('default_colors')
              if !exists("colors_name")
              " Use the macvim color scheme by default
              colorscheme macvim
              endif
              endif

              And I added this line to my ~/.vimrc

              let default_colors=1

              Now MacVim does NOT clobber any of my settings,
              BUT it will default to your setting!

              Bill Muench
              Santa Cruz, California

              --
              You received this message from the "vim_mac" 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
            • björn
              ... That sounds like a reasonable solution. I have pushed a patch which will skip loading the macvim color scheme if you add the line let
              Message 6 of 7 , Jan 12, 2012
              • 0 Attachment
                On 12 January 2012 20:20, Bee wrote:
                >
                > I found a simple solution that works well for me.
                > I would like to request the feature added to MacVim.
                >
                > I added a conditional to your $VIM/gvimrc
                >
                > if !exists('default_colors')
                >  if !exists("colors_name")
                >    " Use the macvim color scheme by default
                >    colorscheme macvim
                >  endif
                > endif
                >
                > And I added this line to my ~/.vimrc
                >
                > let default_colors=1
                >
                > Now MacVim does NOT clobber any of my settings,
                > BUT it will default to your setting!

                That sounds like a reasonable solution. I have pushed a patch which
                will skip loading the macvim color scheme if you add the line

                let macvim_skip_colorscheme=1

                to your ~/.vimrc (note that it will NOT work if you put that in your ~/.gvimrc).

                Thanks for the suggestion,
                Björn

                --
                You received this message from the "vim_mac" 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
              • Bee
                ... Thank you Björn. I have added let macvim_skip_colorscheme=1 to the .vimrc I am now ready for the next snapshot. Will there be any new snapshots for osx
                Message 7 of 7 , Jan 13, 2012
                • 0 Attachment
                  On Jan 12, 11:10 pm, björn <bjorn.winck...@...> wrote:
                  > On 12 January 2012 20:20, Bee wrote:
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > > I found a simple solution that works well for me.
                  > > I would like to request the feature added to MacVim.
                  >
                  > > I added a conditional to your $VIM/gvimrc
                  >
                  > > if !exists('default_colors')
                  > >  if !exists("colors_name")
                  > >    " Use the macvim color scheme by default
                  > >    colorscheme macvim
                  > >  endif
                  > > endif
                  >
                  > > And I added this line to my ~/.vimrc
                  >
                  > > let default_colors=1
                  >
                  > > Now MacVim does NOT clobber any of my settings,
                  > > BUT it will default to your setting!
                  >
                  > That sounds like a reasonable solution.  I have pushed a patch which
                  > will skip loading the macvim color scheme if you add the line
                  >
                  >         let macvim_skip_colorscheme=1
                  >
                  > to your ~/.vimrc (note that it will NOT work if you put that in your ~/.gvimrc).
                  >
                  > Thanks for the suggestion,
                  > Björn

                  Thank you Björn.

                  I have added
                  let macvim_skip_colorscheme=1
                  to the .vimrc
                  I am now ready for the next snapshot.

                  Will there be any new snapshots for osx 10.6.8 Snow Leopard?

                  If not, I have edited your gvimrc to add the conditional and it works
                  fine.

                  Bill

                  --
                  You received this message from the "vim_mac" 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.