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

Re: tweaking the size of the tabs

Expand Messages
  • Nico Weber
    Hi Erick, ... See `:h guitablabel` ... No, that s not easy to do. See this thread:
    Message 1 of 18 , Dec 7, 2008
    • 0 Attachment
      Hi Erick,

      On 07.12.2008, at 20:10, Erick Tryzelaar wrote:

      > Hello! MacVim does a lot of things I wish I had previously, so thanks
      > so much for it. I did have a couple tweaks with the tab bar though.
      > First, I don't need the tab button so I disabled it. Second, the
      > starting width of the tab was a little small, so I resized it to
      > Terminal.app's 200px default. Third, I didn't like how the tabs were
      > truncated on the right side. That left me with tabs like:
      >
      > | /U/S/e/P/f/l/... | /U/S/e/P/f/l/... | __init__.py |

      See `:h guitablabel`

      > One thing I definitely couldn't do was allowing you to tear
      > off a tab into it's own window. Is there an easy way to do that?

      No, that's not easy to do. See this thread: http://groups.google.com/group/vim_mac/browse_thread/thread/9ce1cdbbefc27316/7889815165a94d21

      Nico

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Erick Tryzelaar
      ... Thanks Nico. I was looking at that, but I couldn t get it to do what I wanted. Unless there s something I missed, it looks like it s the tab control that s
      Message 2 of 18 , Dec 7, 2008
      • 0 Attachment
        On Sun, Dec 7, 2008 at 9:06 PM, Nico Weber <nicolasweber@...> wrote:
        > See `:h guitablabel`

        Thanks Nico. I was looking at that, but I couldn't get it to do what I
        wanted. Unless there's something I missed, it looks like it's the tab
        control that's stripping off the trailing characters. Is it possible
        to detect the width of the control so that a vim function could
        dynamically rewrite the title of the right size?

        >> One thing I definitely couldn't do was allowing you to tear
        >> off a tab into it's own window. Is there an easy way to do that?
        >
        > No, that's not easy to do. See this thread: http://groups.google.com/group/vim_mac/browse_thread/thread/9ce1cdbbefc27316/7889815165a94d21

        Oh, yeah, looks like a very hard problem. Nevermind then :)

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • björn
        Hi Erick, Thanks for the patch. ... Ok, but I don t really see the need to have it disabled by default since it hides itself when the tabline is filled up
        Message 3 of 18 , Dec 9, 2008
        • 0 Attachment
          Hi Erick,

          Thanks for the patch.

          2008/12/8 Erick Tryzelaar <erick.tryzelaar@...>:
          >
          > First, I don't need the tab button so I disabled it.

          Ok, but I don't really see the need to have it disabled by default
          since it hides itself when the tabline is filled up anyway. If
          anybody else disagrees with me, then please speak up (it would be easy
          enough to add a user default to disable this button if some people
          prefer not to have this button).

          > Second, the
          > starting width of the tab was a little small, so I resized it to
          > Terminal.app's 200px default.

          You don't need to modify the source code to do this. Open Terminal and type:

          defaults write org.vim.MacVim MMTabOptimumWidth 200

          and restart MacVim (see ":h macvim-prefs" and ":h macvim|/mmtab"). (I
          personally think 200px looks a bit too wide.)

          > Third, I didn't like how the tabs were
          > truncated on the right side. That left me with tabs like:
          >
          > | /U/S/e/P/f/l/... | /U/S/e/P/f/l/... | __init__.py |
          >
          > Which weren't that helpful. Since it didn't look like PSMTabBarControl
          > actually exposes that, I hacked that in too. It'd be a lot better to
          > have these as .gvimrc options though, but I couldn't figure out how to
          > do that.

          Yes, it does seem to make more sense to have the tab labels truncate
          from the left instead of on the right. Does anybody else care to
          weigh in on this? I'll have to try it out myself for a bit to see if
          left truncation is better than right truncation before I'd merge this
          change.

          Thanks,
          Björn

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Erick Tryzelaar
          On Tue, Dec 9, 2008 at 11:55 AM, björn wrote: First, I don t need the tab button so I disabled it. Ok, but I don t really
          Message 4 of 18 , Dec 9, 2008
          • 0 Attachment
            On Tue, Dec 9, 2008 at 11:55 AM, björn <bjorn.winckler@...> wrote:
            >> First, I don't need the tab button so I disabled it.
            >
            > Ok, but I don't really see the need to have it disabled by default
            > since it hides itself when the tabline is filled up anyway. If
            > anybody else disagrees with me, then please speak up (it would be easy
            > enough to add a user default to disable this button if some people
            > prefer not to have this button).

            Oh sure, it was just something I wanted myself, I don't expect you you
            actually integrate this patch, it was more just to demonstrate the
            kind of functionality I was looking for. Having it be a user default
            would be exactly what I'd be looking for.

            >
            >> Second, the
            >> starting width of the tab was a little small, so I resized it to
            >> Terminal.app's 200px default.
            >
            > You don't need to modify the source code to do this. Open Terminal and type:
            >
            > defaults write org.vim.MacVim MMTabOptimumWidth 200
            >
            > and restart MacVim (see ":h macvim-prefs" and ":h macvim|/mmtab"). (I
            > personally think 200px looks a bit too wide.)

            That's great! I didn't know you could do that. I looked through the
            ":h macvim" docs, but I didn't see that listed. Thanks so much for
            that.

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_mac" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Matt Tolton
            ... I agree that it makes more sense. --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_mac maillist. For more
            Message 5 of 18 , Dec 9, 2008
            • 0 Attachment
              > Yes, it does seem to make more sense to have the tab labels truncate
              > from the left instead of on the right. Does anybody else care to
              > weigh in on this? I'll have to try it out myself for a bit to see if
              > left truncation is better than right truncation before I'd merge this
              > change.

              I agree that it makes more sense.

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_mac" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Sergio Acosta
              ... I also vote for the right truncation on the tab text. I know this is not a one size fits all solution, but I find myself editing files from the same
              Message 6 of 18 , Dec 9, 2008
              • 0 Attachment
                On Dec 9, 2008, at 1:55 PM, björn wrote:
                > Yes, it does seem to make more sense to have the tab labels truncate
                > from the left instead of on the right. Does anybody else care to
                > weigh in on this? I'll have to try it out myself for a bit to see if
                > left truncation is better than right truncation before I'd merge this
                > change.

                I also vote for the right truncation on the tab text.

                I know this is not a one size fits all solution, but I find myself
                editing files from the same directory more often than files from many
                different paths, and being able to see the filename or part of it
                would be more useful in my case.


                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_mac" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • scasware
                ... Sorry, I meant *left* truncation. I would like to keep the right side of the path/filename visible. --~--~---------~--~----~------------~-------~--~----~
                Message 7 of 18 , Dec 9, 2008
                • 0 Attachment
                  On Dec 9, 3:39 pm, Sergio Acosta <sergio.aco...@...> wrote:
                  > I also vote for the right truncation on the tab text.

                  Sorry, I meant *left* truncation. I would like to keep the right side
                  of the path/filename visible.
                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_mac" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Jonathon Mah
                  ... Perhaps we need to make this a bit more complicated. It makes sense to truncate the left side of the path, but the start of the filename is generally the
                  Message 8 of 18 , Dec 9, 2008
                  • 0 Attachment
                    On 2008-12-10, at 06:25, björn wrote:

                    > Yes, it does seem to make more sense to have the tab labels truncate
                    > from the left instead of on the right. Does anybody else care to
                    > weigh in on this?


                    Perhaps we need to make this a bit more complicated. It makes sense to
                    truncate the left side of the path, but the start of the filename is
                    generally the most important part. As a bit of a contrived example,
                    consider two files open in the same directory (so no path bits are
                    shown). With right-truncation of the filename, you'd see:

                    employees_contr... | payroll_controll...

                    But with left truncation, you'd likely see:

                    ...s_controller.rb | ...ll_controller.rb

                    So I think it might need some more smarts.



                    Jonathon Mah
                    me@...



                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_mac" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Sergio Acosta
                    ... Consider how other editors handle tabs: Both TextMate, BBEdit (and even Microsoft Visual Studio) always show the full filename on the tab, no truncation,
                    Message 9 of 18 , Dec 9, 2008
                    • 0 Attachment
                      On Dec 9, 2008, at 7:11 PM, Jonathon Mah wrote:

                      > Perhaps we need to make this a bit more complicated. It makes sense to
                      > truncate the left side of the path, but the start of the filename is
                      > generally the most important part. As a bit of a contrived example,
                      > consider two files open in the same directory (so no path bits are
                      > shown). With right-truncation of the filename, you'd see:
                      >
                      > employees_contr... | payroll_controll...
                      >
                      > But with left truncation, you'd likely see:
                      >
                      > ...s_controller.rb | ...ll_controller.rb
                      >
                      > So I think it might need some more smarts.

                      Consider how other editors handle tabs:

                      Both TextMate, BBEdit (and even Microsoft Visual Studio) always show
                      the full filename on the tab, no truncation, but also no directory
                      components.

                      That means:

                      - You cannot see the path until you hover the mouse over the tab, and
                      a tooltip is shown with the full file path.
                      - The tab sizes are different for each tab, and they depend on the
                      file name lenght, so the implementation could turn more complicated.

                      I had never noticed how other programs did it, but now that I saw it,
                      it seems a good solution. I wouldn't mind seeing only the filename and
                      not the path on the tab.

                      my 2 cents.

                      sergio

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_mac" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Matt Tolton
                      Actually I retract my vote for this. I just realized that I have my tab labels set to only show the filename. I don t think I d be happy about seeing the end
                      Message 10 of 18 , Dec 10, 2008
                      • 0 Attachment
                        Actually I retract my vote for this. I just realized that I have my
                        tab labels set to only show the filename. I don't think I'd be happy
                        about seeing the end of the filename, rather than the beginning.
                        Oops. :)

                        On Tue, Dec 9, 2008 at 11:18 PM, Sergio Acosta <sergio.acosta@...> wrote:
                        >
                        >
                        > On Dec 9, 2008, at 7:11 PM, Jonathon Mah wrote:
                        >
                        >> Perhaps we need to make this a bit more complicated. It makes sense to
                        >> truncate the left side of the path, but the start of the filename is
                        >> generally the most important part. As a bit of a contrived example,
                        >> consider two files open in the same directory (so no path bits are
                        >> shown). With right-truncation of the filename, you'd see:
                        >>
                        >> employees_contr... | payroll_controll...
                        >>
                        >> But with left truncation, you'd likely see:
                        >>
                        >> ...s_controller.rb | ...ll_controller.rb
                        >>
                        >> So I think it might need some more smarts.
                        >
                        > Consider how other editors handle tabs:
                        >
                        > Both TextMate, BBEdit (and even Microsoft Visual Studio) always show
                        > the full filename on the tab, no truncation, but also no directory
                        > components.
                        >
                        > That means:
                        >
                        > - You cannot see the path until you hover the mouse over the tab, and
                        > a tooltip is shown with the full file path.
                        > - The tab sizes are different for each tab, and they depend on the
                        > file name lenght, so the implementation could turn more complicated.
                        >
                        > I had never noticed how other programs did it, but now that I saw it,
                        > it seems a good solution. I wouldn't mind seeing only the filename and
                        > not the path on the tab.
                        >
                        > my 2 cents.
                        >
                        > sergio
                        >
                        > >
                        >

                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_mac" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • Jonathon Mah
                        ... Seems reasonable. You motivated me enough to add support for guitabtooltip, so this is possible. (Patch is attached.) With this support, the following
                        Message 11 of 18 , Dec 11, 2008
                        • 0 Attachment
                          On 2008-12-10, at 17:48, Sergio Acosta wrote:

                          > I had never noticed how other programs did it, but now that I saw it,
                          > it seems a good solution. I wouldn't mind seeing only the filename and
                          > not the path on the tab.

                          Seems reasonable. You motivated me enough to add support for
                          guitabtooltip, so this is possible. (Patch is attached.) With this
                          support, the following config will get what you described:

                          set guitablabel=%t
                          set guitabtooltip=%F



                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_mac" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • björn
                          ... Thanks for the patch Jonathon. I started looking at it and ended up cleaning it up a little bit: 1. I had done some dubious coding with the conversion to
                          Message 12 of 18 , Dec 11, 2008
                          • 0 Attachment
                            2008/12/11 Jonathon Mah <me@...>:
                            > On 2008-12-10, at 17:48, Sergio Acosta wrote:
                            >
                            >> I had never noticed how other programs did it, but now that I saw it,
                            >> it seems a good solution. I wouldn't mind seeing only the filename and
                            >> not the path on the tab.
                            >
                            > Seems reasonable. You motivated me enough to add support for
                            > guitabtooltip, so this is possible. (Patch is attached.)

                            Thanks for the patch Jonathon. I started looking at it and ended up
                            cleaning it up a little bit:

                            1. I had done some dubious coding with the conversion to utf8 in that
                            I did not update the string size (or length) variable after conversion
                            (and obviously the byte size may change after conversion) so I changed
                            things around a bit (in MMBackend.m).

                            2. I moved the tooltips from being stored inside a dictionary into the
                            PSMTabBarCell class since it seemed cleaner.

                            Finally, after playing around with it I noticed that with this patch
                            the tooltips will always show -- even if the tooltip and tab label are
                            identical and the label fits inside the tab. (Before the patch a
                            tooltip would only appear if the tab was truncated [of course, there
                            was no support for 'guitabtooltip' then].) I find this a bit
                            annoying. Assuming you agree with me; do you think you can fix this?
                            (I guess you have to check if the tooltip and label are identical and
                            whether the label fits of not...which seems a bit contrived, but...)

                            Thanks,
                            Björn

                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_mac" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---
                          • Jonathon Mah
                            Hi Björn, Sorry for the delay in getting back to you. ... Yes, this is definitely better, and is what I should have done to start with. ... I don t think I
                            Message 13 of 18 , Dec 30, 2008
                            • 0 Attachment
                              Hi Björn,

                              Sorry for the delay in getting back to you.

                              On 2008-12-12, at 06:45, björn wrote:

                              > 2. I moved the tooltips from being stored inside a dictionary into the
                              > PSMTabBarCell class since it seemed cleaner.

                              Yes, this is definitely better, and is what I should have done to
                              start with.

                              > Finally, after playing around with it I noticed that with this patch
                              > the tooltips will always show -- even if the tooltip and tab label are
                              > identical and the label fits inside the tab. (Before the patch a
                              > tooltip would only appear if the tab was truncated [of course, there
                              > was no support for 'guitabtooltip' then].) I find this a bit
                              > annoying. Assuming you agree with me; do you think you can fix this?


                              I don't think I agree here, but I would like to get some other
                              opinions. Personally, I think I could tell that a tab's label and
                              tooltip were the same quicker if they both appeared, instead of
                              needing to wait an extra second or two to be sure that the tooltip
                              wasn't going to show.

                              If you disagree, it's a simple matter of reusing code from
                              0229279b694dd8aff738642dd5ab8739577102b8.



                              Jonathon Mah
                              me@...



                              --~--~---------~--~----~------------~-------~--~----~
                              You received this message from the "vim_mac" maillist.
                              For more information, visit http://www.vim.org/maillist.php
                              -~----------~----~----~----~------~----~------~--~---
                            • björn
                              ... Yes, that makes sense. Lets just keep it the way it is. Björn --~--~---------~--~----~------------~-------~--~----~ You received this message from the
                              Message 14 of 18 , Dec 30, 2008
                              • 0 Attachment
                                2008/12/30 Jonathon Mah <me@...>:
                                >> Finally, after playing around with it I noticed that with this patch
                                >> the tooltips will always show -- even if the tooltip and tab label are
                                >> identical and the label fits inside the tab. (Before the patch a
                                >> tooltip would only appear if the tab was truncated [of course, there
                                >> was no support for 'guitabtooltip' then].) I find this a bit
                                >> annoying. Assuming you agree with me; do you think you can fix this?
                                >
                                > I don't think I agree here, but I would like to get some other
                                > opinions. Personally, I think I could tell that a tab's label and
                                > tooltip were the same quicker if they both appeared, instead of
                                > needing to wait an extra second or two to be sure that the tooltip
                                > wasn't going to show.

                                Yes, that makes sense. Lets just keep it the way it is.

                                Björn

                                --~--~---------~--~----~------------~-------~--~----~
                                You received this message from the "vim_mac" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                                -~----------~----~----~----~------~----~------~--~---
                              • björn
                                ... I have added a user default (MMShowAddTabButton) so that you can toggle the add tab button. To disable it, enter the following command in Terminal (it s
                                Message 15 of 18 , Jan 4, 2009
                                • 0 Attachment
                                  2008/12/9 Erick Tryzelaar <erick.tryzelaar@...>:
                                  > On Tue, Dec 9, 2008 at 11:55 AM, björn <bjorn.winckler@...> wrote:
                                  >>> First, I don't need the tab button so I disabled it.
                                  >>
                                  >> Ok, but I don't really see the need to have it disabled by default
                                  >> since it hides itself when the tabline is filled up anyway. If
                                  >> anybody else disagrees with me, then please speak up (it would be easy
                                  >> enough to add a user default to disable this button if some people
                                  >> prefer not to have this button).
                                  >
                                  > Oh sure, it was just something I wanted myself, I don't expect you you
                                  > actually integrate this patch, it was more just to demonstrate the
                                  > kind of functionality I was looking for. Having it be a user default
                                  > would be exactly what I'd be looking for.

                                  I have added a user default (MMShowAddTabButton) so that you can
                                  toggle the "add tab" button. To disable it, enter the following
                                  command in Terminal (it's not in snap 40 though, so you'd have to
                                  build your own binary first):

                                  defaults write org.vim.MacVim MMShowAddTabButton 0

                                  Björn

                                  --~--~---------~--~----~------------~-------~--~----~
                                  You received this message from the "vim_mac" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                  -~----------~----~----~----~------~----~------~--~---
                                • Fredrik Bränström
                                  That doesn t work over here. OS X 10.5.6, MacVim s40. Tried both 0 and false. ... --~--~---------~--~----~------------~-------~--~----~ You received this
                                  Message 16 of 18 , Jan 9, 2009
                                  • 0 Attachment
                                    That doesn't work over here. OS X 10.5.6, MacVim s40. Tried both 0 and
                                    false.

                                    On Jan 4, 6:14 pm, "björn" <bjorn.winck...@...> wrote:
                                    > 2008/12/9 Erick Tryzelaar <erick.tryzel...@...>:
                                    >
                                    > > On Tue, Dec 9, 2008 at 11:55 AM, björn <bjorn.winck...@...> wrote:
                                    > >>> First, I don't need the tab button so I disabled it.
                                    >
                                    > >> Ok, but I don't really see the need to have it disabled by default
                                    > >> since it hides itself when the tabline is filled up anyway.  If
                                    > >> anybody else disagrees with me, then please speak up (it would be easy
                                    > >> enough to add a user default to disable this button if some people
                                    > >> prefer not to have this button).
                                    >
                                    > > Oh sure, it was just something I wanted myself, I don't expect you you
                                    > > actually integrate this patch, it was more just to demonstrate the
                                    > > kind of functionality I was looking for. Having it be a user default
                                    > > would be exactly what I'd be looking for.
                                    >
                                    > I have added a user default (MMShowAddTabButton) so that you can
                                    > toggle the "add tab" button.  To disable it, enter the following
                                    > command in Terminal (it's not in snap 40 though, so you'd have to
                                    > build your own binary first):
                                    >
                                    > defaults write org.vim.MacVim MMShowAddTabButton 0
                                    >
                                    > Björn
                                    --~--~---------~--~----~------------~-------~--~----~
                                    You received this message from the "vim_mac" maillist.
                                    For more information, visit http://www.vim.org/maillist.php
                                    -~----------~----~----~----~------~----~------~--~---
                                  • björn
                                    ... It will be included in snapshot 41. Björn --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_mac maillist. For
                                    Message 17 of 18 , Jan 9, 2009
                                    • 0 Attachment
                                      2009/1/10 Fredrik Bränström <branstrom@...>:
                                      >
                                      > That doesn't work over here. OS X 10.5.6, MacVim s40. Tried both 0 and
                                      > false.

                                      You missed this part of my post:

                                      >> (it's not in snap 40 though, so you'd have to
                                      >> build your own binary first):

                                      It will be included in snapshot 41.

                                      Björn

                                      --~--~---------~--~----~------------~-------~--~----~
                                      You received this message from the "vim_mac" maillist.
                                      For more information, visit http://www.vim.org/maillist.php
                                      -~----------~----~----~----~------~----~------~--~---
                                    Your message has been successfully submitted and would be delivered to recipients shortly.