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

Re: Macvim seems not to be reading my .vimrc

Expand Messages
  • Ben Fritz
    ... I ve never seen getfontname() return nothing. Without arguments, getfontname() is supposed to return whatever font is actually being used by gvim, whether
    Message 1 of 21 , Jun 17, 2013
    • 0 Attachment
      On Monday, June 17, 2013 1:06:38 PM UTC-5, Eric Weir wrote:
      > Yes, I edited the .vimrc. Used the default mac text editor, textedit. :echo getfontname() returns nothing.
      >

      I've never seen getfontname() return nothing.

      Without arguments, getfontname() is supposed to return whatever font is actually being used by gvim, whether it was found in the guifont option, or is just the default font.

      However it doesn't work if the GUI is not running. Did you run the ":echo getfontname()" command manually from gvim, after it is all the way started up, and not in your .vimrc, etc.?

      Note, the best way to set a font, is to use the dialog, with ":set guifont=*"

      Then you can make note of the exact font string used, by doing ":set guifont?" to echo it, and use that string in your .vimrc or .gvimrc.

      Font strings differ greatly depending on the system Vim is running on.

      --
      --
      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/groups/opt_out.
    • Eric Weir
      ... Thanks again, Ben. I m using macvim. I ran getfontname() from the command line. ... I have this in my .vimrc: set guifont=Monaco:h14 When I do :set
      Message 2 of 21 , Jun 17, 2013
      • 0 Attachment
        On Jun 17, 2013, at 3:13 PM, Ben Fritz <fritzophrenic@...> wrote:

        > On Monday, June 17, 2013 1:06:38 PM UTC-5, Eric Weir wrote:
        >
        >> Yes, I edited the .vimrc. Used the default mac text editor, textedit. :echo getfontname() returns nothing.
        >
        > I've never seen getfontname() return nothing.
        >
        > Without arguments, getfontname() is supposed to return whatever font is actually being used by gvim, whether it was found in the guifont option, or is just the default font.
        >
        > However it doesn't work if the GUI is not running. Did you run the ":echo getfontname()" command manually from gvim, after it is all the way started up, and not in your .vimrc, etc.?

        Thanks again, Ben.

        I'm using macvim. I ran getfontname() from the command line.

        > Note, the best way to set a font, is to use the dialog, with ":set guifont=*"
        >
        > Then you can make note of the exact font string used, by doing ":set guifont?" to echo it, and use that string in your .vimrc or .gvimrc.

        I have this in my .vimrc: set guifont=Monaco:h14

        When I do :set guifont? I get set guifont=Monaco:h10

        Regards,
        ------------------------------------------------------------------------------------------
        Eric Weir
        Decatur, GA USA
        eeweir@...

        "With an ounce of willingness, everything can change."

        - Kim




        --
        --
        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/groups/opt_out.
      • Eric Weir
        ... That was a typo, Bill. That s what I actually have. ... Eric Weir Decatur, GA USA eeweir@bellsouth.net Uncertainty is an uncomfortable position, but
        Message 3 of 21 , Jun 17, 2013
        • 0 Attachment
          On Jun 17, 2013, at 2:15 PM, Bee <forth@...> wrote:

          >>> What does this return?
          >>
          >>> :set guifont?
          >>
          >> guifont=Monaco:10
          >>
          >> That's what it was before I made the change. The change was to Monaco:14
          >
          > Should be:
          >
          > Monaco:h14

          That was a typo, Bill. That's what I actually have.

          ------------------------------------------------------------------------------------------
          Eric Weir
          Decatur, GA USA
          eeweir@...

          "Uncertainty is an uncomfortable position,
          but certainty is an absurd one."

          - Voltaire

          --
          --
          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/groups/opt_out.
        • Eric Weir
          ... I ve been making my changes in the .vimrc. ... For as long as I ve been using vim I ve set this in my .vimrc. Should I be doing it in the .gvimrc? ... Eric
          Message 4 of 21 , Jun 17, 2013
          • 0 Attachment
            On Jun 17, 2013, at 2:07 PM, Bee <forth@...> wrote:

            > Using the font menu item does not change your .vimrc, you need to
            > edit.

            I've been making my changes in the .vimrc.

            > I have this in .gvimrc, it will choose the first VALID font in the
            > comma separated list:
            >
            > set antialias guifont=
            > \Menlo_Bold:h14,
            > \Lucida_Sans_Typewriter_Bold:h14,
            > \Courier_New_Bold:h14,
            > \Courier_Bold:h14,
            > \Monaco:h12,
            >
            > I like to keep vim and gvim (MacVim) settings in separate files.

            For as long as I've been using vim I've set this in my .vimrc. Should I be doing it in the .gvimrc?

            ------------------------------------------------------------------------------------------
            Eric Weir
            Decatur, GA USA
            eeweir@...



            --
            --
            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/groups/opt_out.
          • Steve Litt
            On Mon, 17 Jun 2013 18:00:17 -0400 ... Eric, A little experimentation would probably get you the answers you need. But here s complete documentation on how to
            Message 5 of 21 , Jun 17, 2013
            • 0 Attachment
              On Mon, 17 Jun 2013 18:00:17 -0400
              Eric Weir <eeweir@...> wrote:

              >
              > On Jun 17, 2013, at 2:07 PM, Bee <forth@...> wrote:
              >
              > > Using the font menu item does not change your .vimrc, you need to
              > > edit.
              >
              > I've been making my changes in the .vimrc.
              >
              > > I have this in .gvimrc, it will choose the first VALID font in the
              > > comma separated list:
              > >
              > > set antialias guifont=
              > > \Menlo_Bold:h14,
              > > \Lucida_Sans_Typewriter_Bold:h14,
              > > \Courier_New_Bold:h14,
              > > \Courier_Bold:h14,
              > > \Monaco:h12,
              > >
              > > I like to keep vim and gvim (MacVim) settings in separate files.
              >
              > For as long as I've been using vim I've set this in my .vimrc. Should
              > I be doing it in the .gvimrc?

              Eric,

              A little experimentation would probably get you the answers you need.
              But here's complete documentation on how to do this:

              http://www.troubleshooters.com/linux/vifont.htm

              SteveT

              --
              --
              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/groups/opt_out.
            • Bee
              ... Check the MacVim Preferences... in the MacVim menu, In the Advanced tab uncheck [ ] Enable Quickstart, or uncheck all items for troubleshooting. With [x]
              Message 6 of 21 , Jun 17, 2013
              • 0 Attachment
                On Jun 17, 3:00 pm, Eric Weir <eew...@...> wrote:
                > On Jun 17, 2013, at 2:07 PM, Bee <fo...@...> wrote:
                >...
                > > I like to keep vim and gvim (MacVim) settings in separate files.
                > For as long as I've been using vim I've set this in my .vimrc.
                > Should I be doing it in the .gvimrc?

                Check the MacVim 'Preferences...' in the MacVim menu,
                In the Advanced tab uncheck [ ] Enable Quickstart, or
                uncheck all items for troubleshooting.

                With [x] Enable Quickstart checked the .vimrc file is not reloaded
                after changes.

                QUIT (really... quit from the MacVim menu 'Quit MacVim', not just
                clicking the window red dot) and restart MacVim and check the font
                visually and with:

                :set guifont?

                If it is not fixed more troubleshooting:

                I like the separation, terminal vim settings in .vimrc, gvim (MacVim)
                in .gvimrc. That has helped me isolate some setting errors.

                It may be that some plugin or a setting is clobbering your guifont
                setting.

                Use MacVim (TextEdit may not be pure plain text) to create a .gvimrc
                with only:

                :set guifont=Monaco:h14

                Remove the guifont setting in your .vimrc, search for more than one
                instance of guifont.

                Then put 'finish' (without quotes) at the TOP of the .vimrc file so it
                skips the remaining settings and only loads the .gvimrc.

                If it is good, then you know it is something later in .vimrc.
                Move the 'finish' down until you find the culprit.

                Bill

                --
                --
                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/groups/opt_out.
              • Eric Weir
                ... Thanks for the suggestions for diagnosis, Bill. Following them I found the culprit. I use vundle to manage plugins. One of the plugins is sessions. When
                Message 7 of 21 , Jun 18, 2013
                • 0 Attachment
                  On Jun 18, 2013, at 12:53 AM, Bee <forth@...> wrote:

                  > Use MacVim (TextEdit may not be pure plain text) to create a .gvimrc
                  > with only:
                  >
                  > :set guifont=Monaco:h14
                  >
                  > Remove the guifont setting in your .vimrc, search for more than one
                  > instance of guifont.
                  >
                  > Then put 'finish' (without quotes) at the TOP of the .vimrc file so it
                  > skips the remaining settings and only loads the .gvimrc.
                  >
                  > If it is good, then you know it is something later in .vimrc.
                  > Move the 'finish' down until you find the culprit.

                  Thanks for the suggestions for diagnosis, Bill. Following them I found the culprit.

                  I use vundle to manage plugins. One of the plugins is 'sessions.' When 'finish' appears after the call for 'sessions' font type reverts from Monaco:h14 to Monaco:h10.

                  I have no idea what to do about that. I tried putting 'set guifont=Monaco:h14 after the call for 'sessions' but that had no effect.

                  ------------------------------------------------------------------------------------------
                  Eric Weir
                  Decatur, GA USA
                  eeweir@...

                  "Any assurance economists pretend to with
                  regard to cause and effect is merely a pose."

                  - Emanuel Derman




                  --
                  --
                  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/groups/opt_out.
                • Ben Fritz
                  ... I don t know what sessions is, but I assume it automatically saves and loads a Vim session file via :mksession automatically when exiting and entering
                  Message 8 of 21 , Jun 18, 2013
                  • 0 Attachment
                    On Tuesday, June 18, 2013 6:26:39 AM UTC-5, Eric Weir wrote:
                    >
                    >
                    > I use vundle to manage plugins. One of the plugins is 'sessions.' When 'finish' appears after the call for 'sessions' font type reverts from Monaco:h14 to Monaco:h10.
                    >
                    >
                    >
                    > I have no idea what to do about that. I tried putting 'set guifont=Monaco:h14 after the call for 'sessions' but that had no effect.
                    >

                    I don't know what 'sessions' is, but I assume it automatically saves and loads a Vim "session" file via :mksession automatically when exiting and entering Vim.

                    Try removing "options" from your 'sessionoptions' option in your .vimrc. It is there by default and a major annoyance to me. You might tweak 'sessionoptions' to make sure other things you don't want restored blindly are also not included.

                    Another note, and I almost suggested this, now I wish I had: if an option is set differently than you expect, you can do ":verbose set optionname?" to see not only what it is set to, but also what file set it to that value. This would have found the culprit more quickly I think.

                    --
                    --
                    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/groups/opt_out.
                  • Bee
                    ... session.zip 2.3.11 2013-06-06 7.0 Peter Odding • Bug fix: Don t persist &go and &gfn when !has( gui ): http://github.com/xolox/vim-session/commit/4664cc7
                    Message 9 of 21 , Jun 18, 2013
                    • 0 Attachment
                      On Jun 18, 4:26 am, Eric Weir <eew...@...> wrote:
                      > On Jun 18, 2013, at 12:53 AM, Bee <fo...@...> wrote:
                      > ...
                      > Thanks for the suggestions for diagnosis, Bill. Following them I found the culprit.
                      >
                      > I use vundle to manage plugins. One of the plugins is 'sessions.' When 'finish' appears after the call for 'sessions' font type reverts from Monaco:h14 to Monaco:h10.
                      >
                      > I have no idea what to do about that. I tried putting 'set guifont=Monaco:h14 after the call for 'sessions' but that had no effect.

                      session.zip 2.3.11 2013-06-06 7.0 Peter Odding
                      • Bug fix: Don't persist &go and &gfn when !has('gui'):
                      http://github.com/xolox/vim-session/commit/4664cc7

                      It looks like the problem has been addressed,
                      try upgrading to the latest version of session.vim

                      http://www.vim.org/scripts/script.php?script_id=3150

                      Bill

                      --
                      --
                      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/groups/opt_out.
                    • Bee
                      ... Oops... I guess not... !has( gui ) This is a fix for non-gui vim. Maybe you can use the MacVim menu Edit Font Show Fonts To select the font you want,
                      Message 10 of 21 , Jun 18, 2013
                      • 0 Attachment
                        On Jun 18, 9:04 am, Bee <fo...@...> wrote:
                        > On Jun 18, 4:26 am, Eric Weir <eew...@...> wrote:
                        >
                        > > On Jun 18, 2013, at 12:53 AM, Bee <fo...@...> wrote:
                        > > ...
                        > > Thanks for the suggestions for diagnosis, Bill. Following them I found the culprit.
                        >
                        > > I use vundle to manage plugins. One of the plugins is 'sessions.' When 'finish' appears after the call for 'sessions' font type reverts from Monaco:h14 to Monaco:h10.
                        >
                        > > I have no idea what to do about that. I tried putting 'set guifont=Monaco:h14 after the call for 'sessions' but that had no effect.
                        >
                        > session.zip     2.3.11  2013-06-06      7.0     Peter Odding
                        > • Bug fix: Don't persist &go and &gfn when !has('gui'):
                        >    http://github.com/xolox/vim-session/commit/4664cc7
                        >
                        > It looks like the problem has been addressed,
                        > try upgrading to the latest version of session.vim
                        >
                        > http://www.vim.org/scripts/script.php?script_id=3150
                        >
                        > Bill

                        Oops... I guess not... !has('gui')
                        This is a fix for non-gui vim.

                        Maybe you can use the MacVim menu

                        Edit > Font > Show Fonts

                        To select the font you want, and session.vim will save that setting
                        for you.

                        Anyone?
                        When do 'sessions' (made by session.vim) get sourced?
                        I would assume after .vimrc and .gvimrc.

                        This plugin would drive me nuts, it is like the [Mountain] Lion
                        settings to reopen all windows when restarting.

                        Bill


                        --
                        --
                        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/groups/opt_out.
                      • Eric Weir
                        ... I don t have anything in my .vimrc related to sessions except a call for it in the bundle configuration. ... Thanks, for this, Ben. It identified the
                        Message 11 of 21 , Jun 18, 2013
                        • 0 Attachment
                          On Jun 18, 2013, at 10:28 AM, Ben Fritz <fritzophrenic@...> wrote:

                          > I don't know what 'sessions' is, but I assume it automatically saves and loads a Vim "session" file via :mksession automatically when exiting and entering Vim.
                          >
                          > Try removing "options" from your 'sessionoptions' option in your .vimrc. It is there by default and a major annoyance to me. You might tweak 'sessionoptions' to make sure other things you don't want restored blindly are also not included.

                          I don't have anything in my .vimrc related to 'sessions' except a call for it in the 'bundle' configuration.

                          > Another note, and I almost suggested this, now I wish I had: if an option is set differently than you expect, you can do ":verbose set optionname?" to see not only what it is set to, but also what file set it to that value. This would have found the culprit more quickly I think.

                          Thanks, for this, Ben. It identified the file for me in which the .gvimrc setting is getting reset. It's the file in which 'sessions' saves the session. I basically have one session. Just use it over and over. When it's loaded it resets the font to whatever it was when the session was first saved.

                          I created a new session. It now has the font setting as set by my .gvimrc. Problem solved.

                          Thanks for your help, especially that last suggestion.

                          Sincerely,
                          ------------------------------------------------------------------------------------------
                          Eric Weir
                          Decatur, GA USA
                          eeweir@...

                          "What is man without the beasts? If all the beasts were gone,
                          men would die from a great loneliness of spirit."

                          - Chief Seattle






                          --
                          --
                          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/groups/opt_out.
                        • Eric Weir
                          ... I appreciate your following up on this with me, Bill. It s not a bug. It s an artifact of the way I ve been using sessions ---basically reusing the same
                          Message 12 of 21 , Jun 18, 2013
                          • 0 Attachment
                            On Jun 18, 2013, at 12:24 PM, Bee <forth@...> wrote:

                            >> It looks like the problem has been addressed,
                            >> try upgrading to the latest version of session.vim
                            >>
                            >> http://www.vim.org/scripts/script.php?script_id=3150
                            >
                            > Oops... I guess not... !has('gui')
                            > This is a fix for non-gui vim.
                            >
                            > Maybe you can use the MacVim menu
                            > ….
                            > Anyone?
                            > When do 'sessions' (made by session.vim) get sourced?
                            > I would assume after .vimrc and .gvimrc.

                            I appreciate your following up on this with me, Bill.

                            It's not a bug. It's an artifact of the way I've been using 'sessions'---basically reusing the same session over and over. So when the saved session is sourced it sets the font to the value it had when the session was originally save.
                            So I started macvim without loading the session, recreated the session and saved it. Now the session has the font value set in my .gvimrc.

                            Hope I remember this next time I change something in my .gvimrc or .vimrc.

                            Thanks again,
                            ------------------------------------------------------------------------------------------
                            Eric Weir
                            Decatur, GA USA
                            eeweir@...

                            "We do not inherit the earth from our ancestors,
                            we borrow it from our children."

                            - Chief Seattle

                            --
                            --
                            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/groups/opt_out.
                          • Ben Fritz
                            ... Yes, I figured that. But Vim has an option called sessionoptions which controls what actually gets saved in a session file. You can customize the value
                            Message 13 of 21 , Jun 18, 2013
                            • 0 Attachment
                              On Tuesday, June 18, 2013 1:42:52 PM UTC-5, Eric Weir wrote:
                              >
                              > I don't have anything in my .vimrc related to 'sessions' except a call for it in the 'bundle' configuration.
                              >

                              Yes, I figured that. But Vim has an option called 'sessionoptions' which controls what actually gets saved in a session file. You can customize the value of this option in your .vimrc, if desired. See :help 'sessionoptions'.

                              However, I'm coming at this from the viewpoint of having a detailed .vimrc and a lot of plugins all setting options and mappings. I don't need to have Vim remember options in a session, because the options I like are already set in my .vimrc.

                              You may like having options remembered, because then you can simply set the option manually, and the auto-saved session file will remember it and restore it the next time you run Vim.

                              Still, you might want to at least look at :help 'sessionoptions' to see what is available for you to customize.

                              --
                              --
                              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/groups/opt_out.
                            • Eric Weir
                              ... Thanks, Ben I will do it. ... Eric Weir Decatur, GA USA eeweir@bellsouth.net Imagining the other is a powerful antidote to fanaticism and hatred. - Amos
                              Message 14 of 21 , Jun 19, 2013
                              • 0 Attachment
                                On Jun 18, 2013, at 3:32 PM, Ben Fritz <fritzophrenic@...> wrote:

                                > But Vim has an option called 'sessionoptions' which controls what actually gets saved in a session file. You can customize the value of this option in your .vimrc, if desired. See :help 'sessionoptions'.
                                >
                                > However, I'm coming at this from the viewpoint of having a detailed .vimrc and a lot of plugins all setting options and mappings. I don't need to have Vim remember options in a session, because the options I like are already set in my .vimrc.
                                >
                                > You may like having options remembered, because then you can simply set the option manually, and the auto-saved session file will remember it and restore it the next time you run Vim.
                                >
                                > Still, you might want to at least look at :help 'sessionoptions' to see what is available for you to customize.

                                Thanks, Ben I will do it.

                                ------------------------------------------------------------------------------------------
                                Eric Weir
                                Decatur, GA USA
                                eeweir@...

                                "Imagining the other is a powerful antidote to fanaticism and hatred."

                                - Amos Oz

                                --
                                --
                                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/groups/opt_out.
                              Your message has been successfully submitted and would be delivered to recipients shortly.