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

Re: Conditional statement in .vimrc to check if gui or terminal version

Expand Messages
  • Kyle Lippincott
    On linux, I believe it s: if has( gui_running ) I haven t tested if that works in macvim, but if it doesn t, then that should be filed as a bug. ... -- You
    Message 1 of 6 , Oct 15, 2012
    • 0 Attachment
      On linux, I believe it's:
      if has("gui_running")

      I haven't tested if that works in macvim, but if it doesn't, then that should be filed as a bug.

      On Mon, Oct 15, 2012 at 8:32 AM, Aaron Cruz <pferdefleisch@...> wrote:
      I am having problems with the solarized dark colorscheme showing up correctly on my terminal version of MacVim because I don't want to use the solarized **terminal** theme as well.
      I just found the `if has("gui_macvim")` statement but it is getting a true also for my terminal version of MacVim.
      I would be happy solving this with a conditional statement in my .vimrc that looked something like this.
      <code>
      if has("terminal_macvim")
        set background=light
      endif
      </code>
      (This would also have to not break linux vim builds)
      Does such a thing exist?
      Can anyone think of another way of solving this?
      The use case is that I tend to use the terminal version for one off scripts and configs and the GUI version for projects that have some sort of file tree.
      --
      Thanks all,
      aaron

      --
      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
    • Derek Ashley Thomas
      Yep, it works on MacVim. Also, is there a reason you don t put solarized settings in gvimrc? It might simplify things for you. ... -- You received this message
      Message 2 of 6 , Oct 15, 2012
      • 0 Attachment
        Yep, it works on MacVim. 

        Also, is there a reason you don't put solarized settings in gvimrc? It might simplify things for you.

        On Tue, Oct 16, 2012 at 9:16 AM, Kyle Lippincott <spectral@...> wrote:
        On linux, I believe it's:
        if has("gui_running")

        I haven't tested if that works in macvim, but if it doesn't, then that should be filed as a bug.

        On Mon, Oct 15, 2012 at 8:32 AM, Aaron Cruz <pferdefleisch@...> wrote:
        I am having problems with the solarized dark colorscheme showing up correctly on my terminal version of MacVim because I don't want to use the solarized **terminal** theme as well.
        I just found the `if has("gui_macvim")` statement but it is getting a true also for my terminal version of MacVim.
        I would be happy solving this with a conditional statement in my .vimrc that looked something like this.
        <code>
        if has("terminal_macvim")
          set background=light
        endif
        </code>
        (This would also have to not break linux vim builds)
        Does such a thing exist?
        Can anyone think of another way of solving this?
        The use case is that I tend to use the terminal version for one off scripts and configs and the GUI version for projects that have some sort of file tree.
        --
        Thanks all,
        aaron

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

        --
        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
      • Aaron Cruz
        This is working. Fantastic. Thanks. I just found it here https://github.com/altercation/vim-colors-solarized#modify-vimrc and was coming back to report it but
        Message 3 of 6 , Oct 16, 2012
        • 0 Attachment
          This is working. Fantastic. Thanks.

          I just found it here https://github.com/altercation/vim-colors-solarized#modify-vimrc and was coming back to report it but you all beat me to it :P


          On Monday, October 15, 2012 5:32:33 PM UTC+2, Aaron Cruz wrote:
          > I am having problems with the solarized dark colorscheme showing up correctly on my terminal version of MacVim because I don't want to use the solarized **terminal** theme as well.
          > I just found the `if has("gui_macvim")` statement but it is getting a true also for my terminal version of MacVim.
          > I would be happy solving this with a conditional statement in my .vimrc that looked something like this.
          > <code>
          > if has("terminal_macvim")
          > set background=light
          > endif
          > </code>
          > (This would also have to not break linux vim builds)
          > Does such a thing exist?
          > Can anyone think of another way of solving this?
          > The use case is that I tend to use the terminal version for one off scripts and configs and the GUI version for projects that have some sort of file tree.
          > --
          > Thanks all,
          > aaron

          --
          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
        • Aaron Cruz
          ... I didn t know this was a thing. My only issue of separation is that solarized on terminal mode doesn t work for me in dark mode. It even won t switch to
          Message 4 of 6 , Oct 16, 2012
          • 0 Attachment
            > Also, is there a reason you don't put solarized settings in gvimrc? It might simplify things for you.

            I didn't know this was a thing.
            My only issue of separation is that solarized on terminal mode doesn't work for me in dark mode. It even won't switch to light mode from dark mode, just brown turns pink or something. It will start in light mode though and I do like light mode. All of the other settings work in both terminal and gui macvim.

            --
            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
          • dacresni
            ... I always forget about gvim -- You received this message from the vim_mac maillist. Do not top-post! Type your reply below the text you are replying to.
            Message 5 of 6 , Oct 16, 2012
            • 0 Attachment
              On Tuesday, October 16, 2012 4:28:44 AM UTC-5, Aaron Cruz wrote:
              > > Also, is there a reason you don't put solarized settings in gvimrc? It might simplify things for you.
              >
              > I didn't know this was a thing.
              > My only issue of separation is that solarized on terminal mode doesn't work for me in dark mode. It even won't switch to light mode from dark mode, just brown turns pink or something. It will start in light mode though and I do like light mode. All of the other settings work in both terminal and gui macvim.

              I always forget about gvim

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