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

color scheme changes on vimrc file save

Expand Messages
  • Eric Patton
    Hi, I m having a problem in my terminal vim instances, where my color scheme changes to something resembling murphy when I :w the file. I have the colorscheme
    Message 1 of 4 , Jul 30, 2014
    • 0 Attachment
      Hi,

      I'm having a problem in my terminal vim instances, where my color scheme
      changes to something resembling murphy when I :w the file. I have the
      colorscheme set to 'desert' in my vimrc, and there are no other instances of
      a colorscheme command in the vimrc besides that one.

      The peculiar thing is that the colorscheme only switches to become
      murphy-like when I save *my vimrc*. All other text files maintain the
      desert color scheme upon :w. After my vimrc has been saved and the color scheme
      changes to murphy, the :colorscheme command still reports 'desert'.

      I only have one vimrc in $HOME. Just not sure what else could be
      changing the colors like that - any ideas?

      --
      Eric Patton

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Ben Fritz
      ... Does your .vimrc source itself when you save it? Sometimes that can cause problems depending on how commands are ordered. -- -- You received this message
      Message 2 of 4 , Jul 30, 2014
      • 0 Attachment
        On Wednesday, July 30, 2014 1:42:49 PM UTC-5, Eric Patton wrote:
        > Hi,
        >
        >
        >
        > I'm having a problem in my terminal vim instances, where my color scheme
        >
        > changes to something resembling murphy when I :w the file. I have the
        >
        > colorscheme set to 'desert' in my vimrc, and there are no other instances of
        >
        > a colorscheme command in the vimrc besides that one.
        >
        >
        >
        > The peculiar thing is that the colorscheme only switches to become
        >
        > murphy-like when I save *my vimrc*. All other text files maintain the
        >
        > desert color scheme upon :w. After my vimrc has been saved and the color scheme
        >
        > changes to murphy, the :colorscheme command still reports 'desert'.
        >
        >
        >
        > I only have one vimrc in $HOME. Just not sure what else could be
        >
        > changing the colors like that - any ideas?
        >

        Does your .vimrc source itself when you save it? Sometimes that can cause problems depending on how commands are ordered.

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Eric Patton
        ... Yes, my vimrc does source itself, with this command: autocmd! bufwritepost .vimrc source $MYVIMRC It occurs almost at the end of my vimrc; where do you
        Message 3 of 4 , Jul 31, 2014
        • 0 Attachment
          On Wed, Jul 30, 2014 Ben Fritz wrote:
          > On Wednesday, July 30, 2014 1:42:49 PM UTC-5, Eric Patton wrote:
          > > Hi,
          > >
          > >
          > >
          > > I'm having a problem in my terminal vim instances, where my color scheme
          > >
          > > changes to something resembling murphy when I :w the file. I have the
          > >
          > > colorscheme set to 'desert' in my vimrc, and there are no other instances of
          > >
          > > a colorscheme command in the vimrc besides that one.
          > >
          > >
          > >
          > > The peculiar thing is that the colorscheme only switches to become
          > >
          > > murphy-like when I save *my vimrc*. All other text files maintain the
          > >
          > > desert color scheme upon :w. After my vimrc has been saved and the color scheme
          > >
          > > changes to murphy, the :colorscheme command still reports 'desert'.
          > >
          > >
          > >
          > > I only have one vimrc in $HOME. Just not sure what else could be
          > >
          > > changing the colors like that - any ideas?
          > >
          >
          > Does your .vimrc source itself when you save it? Sometimes that can cause problems depending on how commands are ordered.

          Yes, my vimrc does source itself, with this command:

          autocmd! bufwritepost .vimrc source $MYVIMRC

          It occurs almost at the end of my vimrc; where do you think it should appear?

          --
          Eric Patton

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Ben Fritz
          ... Unless you made a very concerted effort to do so, there are likely some portinos of your .vimrc which don t work very well when they run a second time.
          Message 4 of 4 , Jul 31, 2014
          • 0 Attachment
            On Thursday, July 31, 2014 8:13:33 AM UTC-5, Eric Patton wrote:
            >
            > Yes, my vimrc does source itself, with this command:
            >
            > autocmd! bufwritepost .vimrc source $MYVIMRC
            >
            > It occurs almost at the end of my vimrc; where do you think it should appear?
            >

            Unless you made a very concerted effort to do so, there are likely some portinos of your .vimrc which don't work very well when they run a second time.

            Perhaps your colorscheme itself doesn't work well when it runs a second time.

            Perhaps you override the 'background' option in your .vimrc somewhere.

            Perhaps you have autocmds left over from the last startup, that aren't being cleared out.

            Perhaps there is a plugin interfering.

            I think your best bet is the generic debug method:

            1. Try without plugins, if problem goes away, binary search your plugins by removing half at a time and repeating to find the culprit.
            2. Try without .vimrc. If problem goes away, binary search .vimrc by removing stuff or putting a "finish" about halfway through and repeating until you narrow down the problem line(s).

            --
            --
            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

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          Your message has been successfully submitted and would be delivered to recipients shortly.